zavin Posted May 24, 2008 Share Posted May 24, 2008 Is it possible that if someone enters my site from another site that an event can occur? For example can I have any entry entered into my database if a user come to my site from a specific site? Quote Link to comment https://forums.phpfreaks.com/topic/107037-event-from-another-site/ Share on other sites More sharing options...
dezkit Posted May 24, 2008 Share Posted May 24, 2008 $_SERVER["HTTP_REFERER"] Quote Link to comment https://forums.phpfreaks.com/topic/107037-event-from-another-site/#findComment-548695 Share on other sites More sharing options...
minidak03 Posted May 24, 2008 Share Posted May 24, 2008 $_SERVER["HTTP_REFERER"] Yes this will work but only if the other site sends the correct headers you can do something like if($_SERVER["HTTP_REFERER"] == 'www.specificsite.com'){// do code here} This will work about 99% of the time but again if the site is a bit messed up you may not get the information, its header specific. Quote Link to comment https://forums.phpfreaks.com/topic/107037-event-from-another-site/#findComment-548707 Share on other sites More sharing options...
zavin Posted May 24, 2008 Author Share Posted May 24, 2008 From what I have researched this method is not very secure. The refer is sent by the browser to the server which mean the it can be easily be change. I want user to be rewarded if they come to my site by a referred site. By using $_SERVER["HTTP_REFERER"] it looks like some users would not be rewarded because of browser error and some will be able to manipulate it and get rewarded over and over. Quote Link to comment https://forums.phpfreaks.com/topic/107037-event-from-another-site/#findComment-548941 Share on other sites More sharing options...
.josh Posted May 24, 2008 Share Posted May 24, 2008 If you have no control over the refering site, then I'm afraid you're out of luck; that's the only thing offered. Your only consolation is that even though it's fairly easy to spoof (all you really have to do is edit a file on your computer), most people barely know how to turn on their computer. Now, if you DO have control over the refering sites (as in, you can insist certain pieces of code be transmitted from them, look into token passing. Quote Link to comment https://forums.phpfreaks.com/topic/107037-event-from-another-site/#findComment-548945 Share on other sites More sharing options...
zavin Posted May 24, 2008 Author Share Posted May 24, 2008 I do have control of the link the user clicks on to come to my site. Does that help or am I still out of lick? Quote Link to comment https://forums.phpfreaks.com/topic/107037-event-from-another-site/#findComment-548949 Share on other sites More sharing options...
.josh Posted May 24, 2008 Share Posted May 24, 2008 You're still out of luck, unless you are able to dynamically change that link. As in, the refering site has to request a dynamic link from your site, and you have script to generate it, which you'd include the token in it. Quote Link to comment https://forums.phpfreaks.com/topic/107037-event-from-another-site/#findComment-548952 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.