Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //ip address array (change or add them as necessary)
- $IP_Array = array('173.8.241.122', '173.8.241.123');
- //function to get the current pages URL
- function curPageURL() {
- $pageURL = 'http';
- if ($_SERVER["HTTPS"] == "on") {
- $pageURL .= "s";
- }
- $pageURL .= "://";
- if ($_SERVER["SERVER_PORT"] != "80") {
- $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
- }
- else {
- $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
- }
- return $pageURL;
- }
- //set url to current page URL
- $url = curPageURL();
- //get referrer url
- if (!isset($url))
- $url = $_SERVER["HTTP_REFERER"];
- //get the lander and image from the url
- $last = parse_url($url, PHP_URL_PATH);
- $lander = substr($last, -16, 7);
- $image = substr($last, -8, 4);
- //get the users ip address
- $IP_Address = $_SERVER["REMOTE_ADDR"];
- if(in_array($IP_Address, $IP_Array)) {
- //ip matches do nothing
- }
- //ip does not match send to someplace else
- elseif ($lander == 'lander1') {
- header( 'Location: http://domain.com/base.php?c=112&key=123456789&keyword='.$image );
- }
- elseif ($lander == 'lander2') {
- header( 'Location: http://domain.com/base.php?c=112&key=abcdefghi&keyword='.$image );
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement