Read current url

Read current url

am 17.08.2005 23:00:56 von IranMania

Is there a way that I can read the current url.

I have an asp page currently such as default.asp?x=1&y=2&z=3

Now I want to keep the existing parameters and attach another parameter
to it and resend to default.asp

As the original parameters are dynamic, and may or may not be
generated, the only way is to read the current url and to simply add my
new parameter such as h=5 to the url.

I don't know how to read the current url.

I tried Request.ServerVariables("SCRIPT_NAME") but that didn't include
the parameters. i.e. it just returned the default.asp

Thank you for your help.

Re: Read current url

am 17.08.2005 23:14:32 von Bullschmidt

CurrentPage = Request.ServerVariables("SCRIPT_NAME")

And to see all the server variables for a Web page try this:
Response.Write "
Server:
"
For Each varItem in Request.ServerVariables
For I = 1 to Request.ServerVariables(varItem).Count
Response.Write varItem & " = " & Request.ServerVariables(varItem)(I) &
"
"
Next ' Next I.
Next ' Next varItem.

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...

<<
I don't know how to read the current url.
>>


*** Sent via Developersdex http://www.developersdex.com ***

Re: Read current url

am 17.08.2005 23:16:06 von unknown

IranMania wrote:
> Is there a way that I can read the current url.
>
> I have an asp page currently such as default.asp?x=1&y=2&z=3
>
> Now I want to keep the existing parameters and attach another parameter
> to it and resend to default.asp
>
> As the original parameters are dynamic, and may or may not be
> generated, the only way is to read the current url and to simply add my
> new parameter such as h=5 to the url.
>
> I don't know how to read the current url.
>
> I tried Request.ServerVariables("SCRIPT_NAME") but that didn't include
> the parameters. i.e. it just returned the default.asp
>
> Thank you for your help.
>

Look up the Request.ServerVariables() collection.. lots in there worth
knowing, including the "URL" value

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Re: Read current url

am 17.08.2005 23:40:13 von IranMania

Thank you everyone for the posts. I was thinking I could also use
Request.QueryString and simply append that to
Request.ServerVariables("SCRIP=ADT_NAME") or
Request.ServerVariables("URL")=20

Thank you

Re: Read current url

am 18.08.2005 02:20:49 von Bullschmidt

Perhaps something like this:

<%= Request.ServerVariables("SCRIPT_NAME") %>?<%=
Request.ServerVariables("QUERY_STRING") %>

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...

<<
Thank you everyone for the posts. I was thinking I could also use
Request.QueryString and simply append that to
Request.ServerVariables("SCRIP­T_NAME") or
Request.ServerVariables("URL")
>>


*** Sent via Developersdex http://www.developersdex.com ***