$fnumber-1){ // If ran out of quotes, start again! $fnum=0; } if (file_exists($fdirectory.$fcountfile)) { $fnu = fopen ($fdirectory.$fcountfile, "w"); fputs($fnu,$fnum); } else { die("Cant Find $fcountfile"); } } // display the quote on the page echo "$friends[$fnum]"; ?>