request.servervariable("HTTP_REFERER")

i have a problem with request.servervariable("HTTP_REFERER")
when i run it it does not show any data
i am using PWS on win98 machine.

LVL 1
marounkAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

makerpCommented:
i think that this only has something in if the script has been called form another page . if you type the url in the location bar it will probably be blank. or if the calling page is the samepage as the script.

try putting a link in a html page to your script..
ATMCommented:
HTTP_REFERER will return useful data if
Page where You ask for that variable navigated by link, exmpl, You have link:
<A HREF="checkreferer.asp">Check Referer</A>. After click on you can obtain it. Also it will return REFERER if use checkreferer.asp in frames. If REFERER return nothing then that's mean page URL have been directly wrotten in address field of browser. Also in some cases Netscape and Explorer have different behavoir.
makerpCommented:
eeemmm i just said that....
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

ATMCommented:
Also if You use <FORM></FORM> REFERER available...
marounkAuthor Commented:
Adjusted points from 20 to 30
marounkAuthor Commented:
what i am getting is now the url of the iframe link.

what i have is an <iframe> in which there is a link that calls an images to be displayed each time so when i click on the image i get the url that calls the image which is in the iframe but i want is the URL of the main page

let us say i am in yahoo.com
and inside it i have this code
<iframe>http://.....</iframe>
when i click i want the yahoo.com what i am getting is the "http://....."
any ideas ???
makerpCommented:
are you getting the base url in the http_referer of the frame or the frameset ?..

i dont know how http_referer behaves when you are in a frame.

marounkAuthor Commented:
of the frame there is no frameset
makerpCommented:
thats right then .. thats what you should have in the http_referer.

if the link is in a frame thats url is http://test.co.com/test/

then you should have that in http_referer
marounkAuthor Commented:
ok but this not what i want ... i want the page URL !!!!!
makerpCommented:
what the url of the page that has been called.....

i.e. if i call http://example.com/test.asp

you want http://example.com/test.asp
in a http variable...

marounkAuthor Commented:
excatly
makerpCommented:
okay

Request.ServerVariables("URL") for the base url

SCRIPT_NAME for the script name and the virtual dir

ie.

url = Request.ServerVariables("URL")&Request.ServerVariables("SCRIPT_NAME")

will give you you full url

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
makerpCommented:
sorry i mean

response.write(Request.ServerVariables("SERVER_NAME")&Request.ServerVariables("SCRIPT_NAME"))
makerpCommented:
that wont give you the 'http://' bit
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.