mrpeanut420 Posted November 8, 2010 Share Posted November 8, 2010 <?php if ( $_SERVER['HTTP_REFERER'] == "http://domain.net/sub/index.php" ) { echo "true"; } else { echo "false"; } ?> is the code i'm using. /sub/index.php redirects to http://domain.net/index.php it's not seeming to work. please help sort out this bug. Link to comment https://forums.phpfreaks.com/topic/218124-simple-help/ Share on other sites More sharing options...
Rifts Posted November 8, 2010 Share Posted November 8, 2010 are you getting any errors Link to comment https://forums.phpfreaks.com/topic/218124-simple-help/#findComment-1131839 Share on other sites More sharing options...
Anti-Moronic Posted November 8, 2010 Share Posted November 8, 2010 What you need to do instead is echo $_SERVER['HTTP_REFERER'] and check the value of that. Link to comment https://forums.phpfreaks.com/topic/218124-simple-help/#findComment-1131841 Share on other sites More sharing options...
mrpeanut420 Posted November 8, 2010 Author Share Posted November 8, 2010 <html><head><title></title></head> <body> <?php echo $_SERVER['HTTP_REFERER'] ?> </body></html> i'm using that to test the referral and it isn't displaying anything on the webpage am i doing something wrong? no errors or anything, just blank Link to comment https://forums.phpfreaks.com/topic/218124-simple-help/#findComment-1131886 Share on other sites More sharing options...
OldWest Posted November 8, 2010 Share Posted November 8, 2010 <html><head><title></title></head> <body> <?php echo $_SERVER['HTTP_REFERER'] ?> </body></html> i'm using that to test the referral and it isn't displaying anything on the webpage am i doing something wrong? no errors or anything, just blank Have you tried this in several different browsers? Try Chrome, FF, IE, etc.. If you can... Also close out your statement with ; ... Link to comment https://forums.phpfreaks.com/topic/218124-simple-help/#findComment-1131890 Share on other sites More sharing options...
Rifts Posted November 8, 2010 Share Posted November 8, 2010 its because you forgot a semicolon ; Link to comment https://forums.phpfreaks.com/topic/218124-simple-help/#findComment-1131900 Share on other sites More sharing options...
OldWest Posted November 8, 2010 Share Posted November 8, 2010 its because you forgot a semicolon ; semicolon is optional on this statement. Link to comment https://forums.phpfreaks.com/topic/218124-simple-help/#findComment-1131906 Share on other sites More sharing options...
mrpeanut420 Posted November 9, 2010 Author Share Posted November 9, 2010 i added the semicolon to the end of the statement, still the same. i tested it with chrome and internet explorer, still the same. <?php header( 'Location: http://domain.net/sub/test.php' ) ; ?> i'm using that as the redirect code, if that matters at all. anymore suggestions? Link to comment https://forums.phpfreaks.com/topic/218124-simple-help/#findComment-1132110 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.