How to retrieve current page url?

P

Penny

Hi all,

How can I retrieve the current page url(and parameters/arguments) using ASP
code?

The current page is an asp search results page so the url includes the page
name and the criterion(sorry I don't know what they're called) I had the
'post' method tag on the end.

I need to get it and store it so I have an easy way of getting back to this
page at a click of a button a few pages down the track. I've tried using
location and history but I'd like to manage it myself.

Any ideas?

Regards

Penny.
 
A

Adrienne

Hi all,

How can I retrieve the current page url(and parameters/arguments) using
ASP code?

The current page is an asp search results page so the url includes the
page name and the criterion(sorry I don't know what they're called) I
had the 'post' method tag on the end.

I need to get it and store it so I have an easy way of getting back to
this page at a click of a button a few pages down the track. I've tried
using location and history but I'd like to manage it myself.

Any ideas?

Regards

Penny.

Request.ServerVariables("SCRIPT_NAME")
 
K

Ken Jenkins

Thispage = Request.ServerVariables("script_name") & "?" &
Request.Querystring & Request.Form
 
P

Penny

Thanks guys!!

It all seems so simple to you.

It's not a very intuitive name - ("script_name") - is it!

Regards

Penny
 
A

Adrienne

Thanks guys!!

It all seems so simple to you.

It's not a very intuitive name - ("script_name") - is it!

Regards

Penny

Please understand that this method does not always work. If the user has
referrer logging disabled, then that value will be blank when going to
another page.

From your original post, although you wanted to know the variable for
THIS page, I think you really may be looking for Request.ServerVariables
("HTTP_REFERER") [yes, it's spelled right, apparently it was misspelled a
long time ago, and it has stayed that way], but again, if the user has
referrer logging disabled, it will not work. Also, if someone comes from
another site directly to that page, the HTTP_REFERER will be for the
other site.
 

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

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top