Preventing multiple users from writing to the same file.
Posted: Mon Feb 09, 2004 9:25 pm
I've been trying to figure out how to prevent multiple users from writing to the same file at once -- if that causes a conflict. Anybody know how to write a script that would enable multiple users writing to this file to write to it all at once? I've been doing some reading... Does flock() have something to do with it? If more than one person tries to write to this file will they que up or will they die?
else if (!empty($newlink)){
if ($error == "OOPS!<br>"){
$fp=fopen($filename, 'a+');
fwrite ($fp, $cleanlink);
print "<b> Your link:</b> ".str_replace("|","", $cleanlink);
}
else if (!empty($newlink)){
if ($error == "OOPS!<br>"){
$fp=fopen($filename, 'a+');
fwrite ($fp, $cleanlink);
print "<b> Your link:</b> ".str_replace("|","", $cleanlink);
}