Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ServerVariables(
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ServerVariables("HTTP_REFERER")

 Post Reply Post Reply Page  12>
Author
chris@artwebs.c View Drop Down
Newbie
Newbie


Joined: 05 March 2003
Location: United Kingdom
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote chris@artwebs.c Quote  Post ReplyReply Direct Link To This Post Topic: ServerVariables("HTTP_REFERER")
    Posted: 14 March 2003 at 3:11pm

What is wrong with this code?

Session ("CC_referingURL")=request.ServerVariables("HTTP_REFERER")
if (Session ("CC_referingURL")<>"") then Session ("CC_referingURL")="None" End if

Why does it always return "None" in the page and not the ("HTTP_REFERER")

 

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2003 at 3:20pm
Because probably noone is linking to your site (from an other domain that is)
Back to Top
Nigelo View Drop Down
Groupie
Groupie


Joined: 11 October 2002
Location: United Kingdom
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nigelo Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2003 at 4:40pm
Originally posted by chris@artwebs.c chris@artwebs.c wrote:

What is wrong with this code?

Session ("CC_referingURL")=request.ServerVariables("HTTP_REFERER")
if (Session ("CC_referingURL")<>"") then Session ("CC_referingURL")="None" End if

Why does it always return "None" in the page and not the ("HTTP_REFERER")

Maybe I'm missing the point but why not recode as follows:

Session ("CC_referingURL")=request.ServerVariables("HTTP_REFERER")
if (Session ("CC_referingURL")="") then
 Session ("CC_referingURL")="None"
End if

Your example resets Session(CC..) to "None" whenever the Referrer is anything other than a ZLS which is the reverse of what you intended.

Hope this helps
Nigel   

Back to Top
chris@artwebs.c View Drop Down
Newbie
Newbie


Joined: 05 March 2003
Location: United Kingdom
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote chris@artwebs.c Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2003 at 12:20pm

Thanks Nigelo

I have changed the code and it still does not work

I have links to this site, but always get "None" , do all servers support request.ServerVariables("HTTP_REFERER")?

Can this be switched off on the server?

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2003 at 12:38pm
I don't think you can deny a single server variable and it might be that it is only supported on win2k, don't know.
Back to Top
chris@artwebs.c View Drop Down
Newbie
Newbie


Joined: 05 March 2003
Location: United Kingdom
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote chris@artwebs.c Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2003 at 12:50pm

Ok

So, any ideas why it don't work?

 

Back to Top
Nigelo View Drop Down
Groupie
Groupie


Joined: 11 October 2002
Location: United Kingdom
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nigelo Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2003 at 6:56pm

Have taken another look and think that retrieving the referer should be seperated from your Database write as follows:

strRef=request.ServerVariables("HTTP_REFERER")
If strRef="") then strRef="None"

'write strRef to Database or whatever

Hope this helps
Nigel
Back to Top
chris@artwebs.c View Drop Down
Newbie
Newbie


Joined: 05 March 2003
Location: United Kingdom
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote chris@artwebs.c Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2003 at 3:44am

Hi Nigelo,

Still no joy:

Dim strRef
strRef=request.ServerVariables("HTTP_REFERER")
If (strRef="") then strRef="None"
Session ("CC_referingURL")=strRef

Always return "None" even if I write strRef to the page or database.

I have links on other sites, other domains and even in Google.


Any other ideas?

This should work....just can't see why it don't.

Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.