Hi
So I'm trying to figure out how to "flock" a .txt file that I read data from for my PHP image gallery, so far unsuccessfuly, and I was wondering if one of you PHP gurus can show me the light...
Here is what I have so far:
\\ $dir is provided earlier
$pic_info_file="image.txt";
$pic_info=fopen("$dir/$pic_info_file",'r');
flock($pic_info, LOCK_SH);
$contents = fread($pic_info, 20);
flock($pic_info, LOCK_UN);
fclose($pic_info);
$number_pics = count ($contents);
Then on another page were I include the above code I have:
\\ $image is provided earlier
list($filename,$comment,$link) = explode(";",$contents[$image]);
$filename = trim($filename);
$comment = trim($comment);
This code breaks the page, no error, any ideas? If you need to whole page code let me know.
Thanks