As described in our previous article URL QueryString«, where we took a look at a single Query made against the TYPE to get its value. In this article, we will go one step further, a bit more complex, and look at multiple Queries within a single URL String.
First, we looked at this. A single Query and Value to display a message.
CFFCS | CarrzSynEdit: | ASP/VBScript
<%if request.querystring("Type") = "One" then%>
You are on page [One]
<%end if%>

Now, let us take a look at a multiple query URL string.
CFFCS | CarrzSynEdit: | ASP/VBScript
Main.asp?Type=One&ID=1

First, we have Type Query with the value of One, and then we have the additional Query of ID with the value of 1.
Our ASP Statement would look like this.
Using the variable concept we created in the last article.
CFFCS | CarrzSynEdit: | ASP/VBScript
<%
getType = request.querystring("Type")
getID = request.querystring("ID")
if getType="One" then
thePage = "Page Title"
end if
if getID = "1" then
theID = "Page ID"
end if%>

CFFCS | CarrzSynEdit: | ASP/VBScript
<table>
<tr><td><%=theID%></td><td><%=thePage%></td></tr>
<tr><td><%=getID%></td><td><%=getType%></td></tr>
</table>

If we change our Values for both Queries, we will only get the Values in the String, but not the values from the Variables we created above. So we will need to do something a little different to get the values.
With this String.
CFFCS | CarrzSynEdit: | ASP/VBScript
Type=Two&ID=2

We will need to add another set of Values as we did above, or do something like this.
CFFCS | CarrzSynEdit: | ASP/VBScript
<%
if getType <> "" then
thePage = "Page Title"
end if
if getID <> "" then
theID = "Page ID"
end if%>

<table>
<tr><td><%=theID%></td><td><%=thePage%></td></tr>
<tr><td><%=getID%></td><td><%=getType%></td></tr>
</table>



The Greater and Lesser signs with double quotes are used to check whether the value exists in the Query; if it does, show something.

We can also put it all on one line.
CFFCS | CarrzSynEdit: | ASP/VBScript
<%
if getType <> "" and getID <> ""  then
thePage = "Page Title"
theID = "Page ID"
end if%>

<table>
<tr><td><%=theID%></td><td><%=thePage%></td></tr>
<tr><td><%=getID%></td><td><%=getType%></td></tr>
</table>