When user comes to website it stores there ip address. So next time they visit
the site it redirects them a different page.
When user comes to website it stores there ip address. So next time they visit
the site it redirects them a different page.
You need server side coding to do this do you have php, asp, other?
Corrections to my coding/thoughts welcome.
PHP
Make a file called getout.txt. If you do not want some ips to always redirect when viewing the page (for example, you), insert it into thePHP Code:<?php
function find($file, $ip){
$test = strrpos($file, $ip);
$exception = array('0');
if($test !== false && !in_array($ip, $exception)){
header("Location: redirect.php");
} else if (!in_array($ip, $exception)){
file_put_contents('getout.txt', $_SERVER['REMOTE_ADDR']."\n", FILE_APPEND);
}
}
find(file_get_contents('getout.txt'), $_SERVER['REMOTE_ADDR']);
?>$exceptionarray.
Last edited by Nile; 12-28-2010 at 01:15 AM.
Jeremy | jfein.net
Bookmarks