Query String Question

M

Matt

I always see people do something like that, and when the link is clicked, it
will open a new page.

<P><a href="profile.asp?id=493">Item 1<a>
<P><a href="profile.asp?id=495">Item 2<a>
<P><a href="profile.asp?id=497">Item 3<a>

I want to know if is implemented in this way:

In profile.asp

<% If Request.Form("id") = "493" %>
contents for item1
<% ElseIf Request.Form("id") = "495" %>
contents for item2
//etc...??

We put all contents in profile.asp, and open different one based on the
query string value for id?

please advise. Thanks!!
 
P

Patrice

It uses Request.QueryString instead of Request.Form.

It's likely that the content is taken from a database using the id.
Basically :

Set rst=GetRecordset("SELECT * FROM Products WHERE id=" &
RequesT.QueryString("id"))
Response.Write rst("Title") & "<br>"
Response.Write rst("Description") & "<br>"
Response.Write rst("UnitPrice") & "<br>"

etc...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top