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. Quote Link to comment Share on other sites More sharing options...
Rifts Posted November 8, 2010 Share Posted November 8, 2010 are you getting any errors Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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 ; ... Quote Link to comment Share on other sites More sharing options...
Rifts Posted November 8, 2010 Share Posted November 8, 2010 its because you forgot a semicolon ; Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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.