From: "Sarah Gray" <[EMAIL PROTECTED]> > Once a sale is completed a record is written to a log file on the > server. > > $filename = $dir. "/". $logType."_".$today.".txt"; > $fp = fopen("$filename", "a+"); > fputs($fp, $logEntryStr); > fclose($fp);
Consider this: 1. User A completes a transaction. 2. Script A reads the log file 3. User B completes a transaction 4. Script B read the log file 5. Script A write the new line to what was read in #2 6. Script B write the new line to what was read in #4 Now what's in the file? Only what Script B wrote. http://us2.php.net/flock ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php