Solved

request.servervariable("HTTP_REFERER")

Posted on 2000-04-10
15
818 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 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