_giles_ Posted February 11, 2007 Share Posted February 11, 2007 Hi, Is there any way of getting the URL of the page that has passed a visitor to my home page? - I’ve had a look about but can’t find much, am I asking an unusual question? Quote Link to comment https://forums.phpfreaks.com/topic/38029-getting-a-passing-url/ Share on other sites More sharing options...
fert Posted February 11, 2007 Share Posted February 11, 2007 $_SERVER['HTTP_REFERER']; Quote Link to comment https://forums.phpfreaks.com/topic/38029-getting-a-passing-url/#findComment-182041 Share on other sites More sharing options...
GingerRobot Posted February 11, 2007 Share Posted February 11, 2007 You can use $_SERVER["HTTP_REFERER"] to get the reffering URL. Beware though, this can be spoofed and should not be used for security purposes. Quote Link to comment https://forums.phpfreaks.com/topic/38029-getting-a-passing-url/#findComment-182042 Share on other sites More sharing options...
_giles_ Posted February 11, 2007 Author Share Posted February 11, 2007 I don't need it for security, but I was thinking about it as a way of segregating paying from free visitors - (e.g. if visitor comes from a site that's signed up to our full service ...admit to full service, IfElse ... pass onto free pages) ... would that work? Quote Link to comment https://forums.phpfreaks.com/topic/38029-getting-a-passing-url/#findComment-182102 Share on other sites More sharing options...
GingerRobot Posted February 11, 2007 Share Posted February 11, 2007 You should be using a login system along with sessions and a login check on any pages that require membership for this sort of thing. Thats if ive understood what you were saying anyway Quote Link to comment https://forums.phpfreaks.com/topic/38029-getting-a-passing-url/#findComment-182107 Share on other sites More sharing options...
_giles_ Posted February 11, 2007 Author Share Posted February 11, 2007 OK here's the thing ... I'm working on a site that will service users coming from a number or regular clients, and some just browsing. The subscription clients have too many users to issue passwords or login's, so the easiest thing right now would be to log them by URL. session_start() and security will occur after that. So I simply need this ... where did you come from stage ... is $_SERVER["HTTP_REFERER"] stable enough to give me that? Quote Link to comment https://forums.phpfreaks.com/topic/38029-getting-a-passing-url/#findComment-182116 Share on other sites More sharing options...
GingerRobot Posted February 11, 2007 Share Posted February 11, 2007 I would say its really not that stable at all. Firefox can be configured to not send http_referer information, and ive also known some firewalls preventing it from being sent. I investigated using it when i was making a text based game as a means of preventing people sending malicous data from other sources; but it really wasn't a good idea. You will find that legitimate users will suffer. Quote Link to comment https://forums.phpfreaks.com/topic/38029-getting-a-passing-url/#findComment-182119 Share on other sites More sharing options...
_giles_ Posted February 11, 2007 Author Share Posted February 11, 2007 OK ... so maybe ask the visitor to fill in a password displayed on the referring page. that way it's easy for them, that way I get to know of their referred or browsing? Eitherway thanks for shouting me back - I'm wiser and better for it - appreciate you spending the time Quote Link to comment https://forums.phpfreaks.com/topic/38029-getting-a-passing-url/#findComment-182124 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.