Hi
I downloaded kreton.net's image uploading script and wanted to modify it so that it would check which files already exist in the folder then rename the uploaded image to be the next in line e.g. Pic1.jpg exists already so new image would be Pic2.jpg
I tried to do this with file_exists but it didn't seem to work so I have tried using a text file with the next value in and incrementing that. But I now get a syntax error about an unexpected ")" on a line but I can't find where it is (I have checked the entire code and there isn't any ")" out of place).
function fileNumber()
{
$fileName = 'filenumber.txt';
$file = fopen($fileName,r+);
$number = fread($file, 3);
fwrite($file,($number + 1));
fclose($file);
return $number;
}
Any help would be greatly appreciated.
Edited: This is the "problem" code. I don't see a problem with it but others might.