View Single Post
Old 02-12-2005, 03:22 AM  
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
Create a file named "last.txt" and place one single character in it, "0" (zero). Then put the following code in rotate.php and link to it. Change the first variable to the total number of links, in the example it's 2. Add $site["x"] = "URL"; lines for each URL.


Code:
<?PHP
	$total = 2;
	$site["1"] = "http://www.ha4l.com/";
	$site["2"] = "http://www.eg4l.com/";


	$DatFile = "last.txt";
	@ $fp = fopen($DatFile, "r");
	flock($fp, 1);
	$filelength = filesize($DatFile);
	$visits = fread($fp, $filelength);
	flock($fp, 3);
	fclose($fp);

	$visits = $visits + 1;
	if ($visits > $total) { $visits = 0; }

	@ $nfp = fopen($DatFile, "w");
	flock($nfp, 2);
	fwrite($nfp, $visits);
	flock($nfp, 3);
	fclose($nfp);


header("Location: " . $site[$visits] );
?>
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote