note 54157 rejected from function.flush by mazzanet

From: Date: Sat, 25 Jun 2005 08:20:59 +0000
Subject: note 54157 rejected from function.flush by mazzanet
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-90933@lists.php.net to get a copy of this message
Note Submitter: horu ---- What is wrong with this "chat" code? <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2"> <TITLE>Chat 0.98bTITLE> </HEAD> <? if (file_exists("ksiegagosci.txt")) { while(!connection_aborted()) { $mesg = file("ksiegagosci.txt", "r"); if( ereg("T" ,$mesg[0]) ) { $plik = fopen("ksiegagosci.txt","r"); flock($plik,1); fseek($plik,1); while ( !(feof($plik)) ) { alert( fgets ($plik, 2048) ); } flock($plik,3); fclose($plik); $plik = fopen("ksiegagosci.txt","w"); flock($plik,2); fseek($plik,0); fputs($plik,"N"); flock($plik,3); fclose($plik); } ob_flush(); flush(); sleep(2); } } ?> </BODY> </HTML>

« previous php.notes (#90933) next »