View Single Post
Old 03-26-2002, 07:11 PM  
Cirrus
Confirmed User
 
Join Date: Feb 2002
Location: www.Reyko.com
Posts: 1,145
PHP Code:
<?
$url=Array(
  "http://site1.com",
  "http://site2.com"
);



$filename="count.txt";
if (file_exists($filename)):
    $file=file($filename);
    $hits=intval($file[0])+1;
    $fp=fopen($filename,"w+");
else:
    $fp=fopen($filename,"w");
    $hits=0;
endif;
if ($hits>=count($url)) $hits = 0;
fputs($fp,"$hits\n");
fclose($fp);

header("Location: $url[$hits]");


?>
set appropriate CHMOD to count.txt -
I do not claim that this is the best solution
Cirrus is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote