Solved

request.servervariable("HTTP_REFERER")

Posted on 2000-04-10
15
820 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
[X]
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
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to show result of a NULL value at random? 33 59
edit .asp files 5 48
Date on a table 16 35
Update the value of table B with value of table A tables inner join 6 78
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…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

733 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