Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

request.servervariable("HTTP_REFERER")

Posted on 2000-04-10
15
819 Views
Last Modified: 2010-05-18
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.

0
Comment
Question by:marounk
  • 8
  • 5
  • 2
15 Comments
 
LVL 10

Expert Comment

by:makerp
ID: 2699818
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..
0
 
LVL 1

Expert Comment

by:ATM
ID: 2699984
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.
0
 
LVL 10

Expert Comment

by:makerp
ID: 2700010
eeemmm i just said that....
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 1

Expert Comment

by:ATM
ID: 2700063
Also if You use <FORM></FORM> REFERER available...
0
 
LVL 1

Author Comment

by:marounk
ID: 2702937
Adjusted points from 20 to 30
0
 
LVL 1

Author Comment

by:marounk
ID: 2702938
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 ???
0
 
LVL 10

Expert Comment

by:makerp
ID: 2715102
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.

0
 
LVL 1

Author Comment

by:marounk
ID: 2715360
of the frame there is no frameset
0
 
LVL 10

Expert Comment

by:makerp
ID: 2715384
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
0
 
LVL 1

Author Comment

by:marounk
ID: 2715839
ok but this not what i want ... i want the page URL !!!!!
0
 
LVL 10

Expert Comment

by:makerp
ID: 2715854
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...

0
 
LVL 1

Author Comment

by:marounk
ID: 2715976
excatly
0
 
LVL 10

Accepted Solution

by:
makerp earned 30 total points
ID: 2716028
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
0
 
LVL 10

Expert Comment

by:makerp
ID: 2716036
sorry i mean

response.write(Request.ServerVariables("SERVER_NAME")&Request.ServerVariables("SCRIPT_NAME"))
0
 
LVL 10

Expert Comment

by:makerp
ID: 2716042
that wont give you the 'http://' bit
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question