MasterACE14 Posted June 15, 2007 Share Posted June 15, 2007 Is their a function to check what webpage a user came from to get to your webpage? Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/55663-solved-redirection-check/ Share on other sites More sharing options...
redarrow Posted June 15, 2007 Share Posted June 15, 2007 reserved.variables http://uk3.php.net/reserved.variables <?php $page_was_from=$_SERVER['HTTP_REFERER']; echo $page_was_from; ?> The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted. Quote Link to comment https://forums.phpfreaks.com/topic/55663-solved-redirection-check/#findComment-275050 Share on other sites More sharing options...
MasterACE14 Posted June 15, 2007 Author Share Posted June 15, 2007 ok, thankyou. How can I check what webpage they were just on, and if it was the one It should be it executes some code? here's an example, but it doesn't work. <?php if($_SERVER['HTTP_REFERER'] == header("Location: http://www.google.com/") { echo("You were just at google!"); } ?> Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/55663-solved-redirection-check/#findComment-275052 Share on other sites More sharing options...
redarrow Posted June 15, 2007 Share Posted June 15, 2007 reed the link i provide <?php if($_SERVER['HTTP_REFERER'] != ''){ $URL = parse_url($_SERVER['HTTP_REFERER']); echo "Welcome, <b>".$URL['host']."</b> visitor!"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/55663-solved-redirection-check/#findComment-275062 Share on other sites More sharing options...
MasterACE14 Posted June 15, 2007 Author Share Posted June 15, 2007 ok, thanks again. Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/55663-solved-redirection-check/#findComment-275073 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.