Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extracting name-value pairs from an array of querystrings

Status
Not open for further replies.

cm80

Technical User
May 3, 2001
85
US
Hi,
I have an array of querystrings from which I want to extract the separate name value pairs.

For example I have a number of querystrings like the one below and I want to be able to loop through and extract each of the 'Fund' and 'asp' values in the array

deviceid=B5B0C9-249E-1100000-9B91-00902787507C&zipcode=unknown&Fund=BAL&asp=modules/abc/default.asp

Does anyone have any idea where I could start please.
 
Yes, there are a couple of ways you could try out. Here is one:
Code:
For Each Key in Request.QueryString
   Response.Write &quot;Key :&quot; & Key & &quot;<br>&quot;
   Response.Write &quot;Item : &quot; & Request.QueryString.Item(Key) & &quot;<br><br>&quot;
Next
And here is another:
Code:
For counter = 1 to Request.QueryString.Count
   Response.Write &quot;Key number &quot; & counter & &quot; = &quot; & Request.QueryString.Key(counter) & &quot;<br>&quot;
   Response.Write &quot;Item number &quot; & counter & &quot; = &quot; & Request.QueryString.Item(counter) & &quot;<br><br>&quot;
Next
Hope this helps,
Palooka
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top