|
![]() |
|
| Author |
|
|||||||
|
WarT
Posts: 2074
Location: Brisbane, Queensland
|
i need a bit of help getting the ?blah= command working |
|||||||
| #0 10:12am 30/03/01 |
|
|||||||
|
system
|
--
|
|||||||
| #0 |
|
|||||||
|
Khel
Posts: 551
Location: Brisbane, Queensland
|
As in how to read things back from the querystring or how to put things in there? |
|||||||
| #1 10:47am 30/03/01 |
|
|||||||
|
WarT
Posts: 2076
Location: Brisbane, Queensland
|
i wanna know how to read the bit after that and pass it through to the code |
|||||||
| #2 10:55am 30/03/01 |
|
|||||||
|
klayman
Posts: 121
Location: Brisbane, Queensland
|
php. |
|||||||
| #3 10:57am 30/03/01 |
|
|||||||
|
WarT
Posts: 2077
Location: Brisbane, Queensland
|
no asp cause i don't wanna do php |
|||||||
| #4 10:59am 30/03/01 |
|
|||||||
|
Khel
Posts: 554
Location: Brisbane, Queensland
|
In ASP you use the Request.QueryString collection to access arguments in the querystring (the bits after the ?) Say the url was http://www.blah.com/default.asp?Test1=blah&Test2=blah You could access the value of test1 by doing something along the lines of SomeVariable = Request.QueryString("Test1") |
|||||||
| #5 11:04am 30/03/01 |
|
|||||||
|
WarT
Posts: 2078
Location: Brisbane, Queensland
|
cool ta i couldn't remember |
|||||||
| #6 11:11am 30/03/01 |
|
|||||||
|
WarT
Posts: 2079
Location: Brisbane, Queensland
|
still having problems can you icq me plz khel |
|||||||
| #7 11:56am 30/03/01 |
|
|||||||
|
Khel
Posts: 556
Location: Brisbane, Queensland
|
No icq access where I am atm... |
|||||||
| #8 11:58am 30/03/01 |
|
|||||||
|
WarT
Posts: 2080
Location: Brisbane, Queensland
|
s*** s*** s*** s*** s*** s*** s*** s*** s*** s*** |
|||||||
| #9 11:59am 30/03/01 |
|
|||||||
|
WarT
Posts: 2081
Location: Brisbane, Queensland
|
ok what i want is its retail.asp?product=whatver nmy variable is thingo (great names yes) i want select * from thingo to happen can you help me with that? |
|||||||
| #10 12:04pm 30/03/01 |
|
|||||||
|
Khel
Posts: 557
Location: Brisbane, Queensland
|
What are you using for your db access, ADO? The general way to do something like that is to get the variable from the querystring, create the sql query in a string, then pass that string to the execute or open method of your recordset. Using ADO and VBScript it would be something like this. dim SqlQry dim rs thingo = Request.QueryString("product") SqlQry = "SELECT * FROM " & thingo Set rs = CreateObject("adodb.Recordset") rs.Open SqlQry, dbConn dbConn is a reference to a database connection object that you should have already opened previously. If you aren't using ADO that exact syntax wont work, but thats the basic idea behind it :) |
|||||||
| #11 12:21pm 30/03/01 |
|
|||||||
|
WarT
Posts: 2082
Location: Brisbane, Queensland
|
its a dsn-less connection no ado |
|||||||
| #12 12:49pm 30/03/01 |
|
|||||||
|
WarT
Posts: 2084
Location: Brisbane, Queensland
|
good stuff man i only needed one line outta that code you wrote and it worked thanks :P |
|||||||
| #13 12:58pm 30/03/01 |
|
|||||||
|
sKryBe
Posts: 9
Location: Brisbane, Queensland
|
FYI there's some really good ASP help sites out there on the Web. I use ASP 101, ASP Toolbox, The ASP Resource Index and good ole' Microsoft's ASP reference. And if I have questions The FAQTS Knowledge Base is pretty handy too. Enjoy. |
|||||||
| #14 02:16pm 30/03/01 |
|
|||||||
|
sKryBe
Posts: 10
Location: Brisbane, Queensland
|
Oops I stuffed up the Microsoft link. It should be http://msdn.microsoft.com/workshop/server/asp/ASPover.asp |
|||||||
| #15 02:19pm 30/03/01 |
|
|||||||
|
WarT
Posts: 2086
Location: Brisbane, Queensland
|
||||||||
| #16 02:26pm 30/03/01 |
|
|||||||
|
system
|
--
|
|||||||
| #16 |
|
|||||||
|
| ||||||||