Last active
July 25, 2024 16:03
-
-
Save barbwiredmedia/c5dbd557520b93b633ad to your computer and use it in GitHub Desktop.
Checking for page referer in php. Wordpress redirect or header refresh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//check for refering page to switch content based on referrer | |
$referrer = $_SERVER['HTTP_REFERER']; | |
if ($referrer == 'http://url.com' or $referrer == 'http://url-2.com') { | |
//Matches YES! | |
} else { | |
//Matches NO! | |
header( 'Location: http://www.url.com/no-soup-for-you/' ) ; | |
} ?> | |
@MrDoxxer2 if the page that redirected you to the referer.php is equal to url.com then it does something. Otherwise redirect it to something else.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't understand of what it will do if the referre is correct