Location: PHPKode > scripts > CJ Random Quote > cjrandomquotev1/randomquote.php
<?
/* Config Part --------------------------------------------------------------------------------------------------------------*/

$random = true;									// if you want random, keep true, set to false if want sequential
$directory = "/home/www/cj-deign/downloads/randomquote/";								//  Webserver path to your quote files with / on end!
$quotefile = "randomquote.inc";																			//  The Random Quote file
$quotecountfile = "displayquote.inc";																	//  The Display Quote file (IF SEQUENTIAL!) 

/* End of Config Part -------------------------------------------------------------------------------------------------------*/

$quotes = file($directory.$quotefile);
$number = count($quotes);

if($random){
	$num = rand(0,$number-1);
}
else{
	$num = file($directory.$quotecountfile);
	$num = $num[0]+1;
	if($num>$number-1){ // If ran out of quotes, start again!
		$num=0;	
	}
	if (file_exists($directory.$quotecountfile)) {
		$nu = fopen ($directory.$quotecountfile, "w");
		fputs($nu,$num);
	}
	else {
		die("Cant Find $quotecountfile");
	}
}

// display the quote on the page

echo "$quotes[$num]";
?>
Return current item: CJ Random Quote