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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing URL string with it's form parameters

Status
Not open for further replies.

Albuckj2

Programmer
Jan 7, 2003
68
0
0
GB
I have a page (results.asp) which has table at the top, and then a frameset below it. Results.asp gets passed loads of parameters apended to the URL, but I need to pass these variables into one of the frames (results_main.asp). How can I do this?

When I name the frameset, I need to give the "src" attribute as "results_main.asp" and then all the variables appended onto the end.

"Request.ServerVariables("URL")" will give me just "results.asp", and not the rest of the URL string that is created. Is there anyway I can quickly access the full URL without having to do a request.querystring on every element and then re-building the string?
 
Let's say this is your URL:

<%
Response.Write(Request.ServerVariables(&quot;Query_String&quot;))
%>
would give you
pos=programmer&nam=Albuckj2

<%
Response.Write(Request.ServerVariables(&quot;Server_Name&quot;) & Request.ServerVariables(&quot;Path_Info&quot;) & &quot;?&quot; & Request.ServerVariables(&quot;Query_String&quot;) & &quot;<br><br><br>&quot;)
%>
would give you
www.results.asp?pos=programmer&nam=Albuckj2

If you want to display all the server variables you have to work with, try this:
<%
For Each Item in Request.ServerVariables
Response.Write(Item & &quot;: &quot; & Request.ServerVariables(Item) & &quot;<br><br>&quot;)
Next
%>

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top