mtlhd Posted December 19, 2008 Share Posted December 19, 2008 I cant seem to find what is wrong with this script.... $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; if ($referer == "http://www.example.com/"){ $subject = $name . ", referred from example.com"; } Else { $subject = $name; } anyone see why that isnt coming thru, it should be the header of an email, but it never comes thru. My hit counter watching for hits from that referral works fine. craziness. thanks in advance PHP community. Quote Link to comment https://forums.phpfreaks.com/topic/137744-http-referer-problem/ Share on other sites More sharing options...
mtlhd Posted December 19, 2008 Author Share Posted December 19, 2008 those at the end of line 1 are 2 single quote marks , not a double quote by itself, just realized what that looked like. Quote Link to comment https://forums.phpfreaks.com/topic/137744-http-referer-problem/#findComment-719982 Share on other sites More sharing options...
.josh Posted December 19, 2008 Share Posted December 19, 2008 parenthesis around the isset Quote Link to comment https://forums.phpfreaks.com/topic/137744-http-referer-problem/#findComment-719984 Share on other sites More sharing options...
.josh Posted December 19, 2008 Share Posted December 19, 2008 I lied. Seems to work either way. Perhaps you're trying to access page directly, so there's no referer page? Quote Link to comment https://forums.phpfreaks.com/topic/137744-http-referer-problem/#findComment-719987 Share on other sites More sharing options...
tivrfoa Posted December 20, 2008 Share Posted December 20, 2008 I cant seem to find what is wrong with this script.... $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; if ($referer == "http://www.example.com/"){ $subject = $name . ", referred from example.com"; } Else { $subject = $name; } anyone see why that isnt coming thru, it should be the header of an email, but it never comes thru. My hit counter watching for hits from that referral works fine. craziness. thanks in advance PHP community. hello! the page must be exactly as it was referenced. try this to know what you got: <?php $lastPage = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null; // var_dump just to see what you got // null means the page was not referenced var_dump($lastPage); echo '<br />'; if($lastPage == 'http://domain/') echo 'ok'; else echo 'oh shit'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/137744-http-referer-problem/#findComment-720070 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.