Hello,
I have a script that uploads photos to a directory. I am trying to rename the file on the fly with an incrementing value, i.e. 0001.jpg, 0002.jpg. I can not figure out for the life of me how to do it. Usually I would use rand(), but I need the file name to increase incrementally, preferably with the date prefixed. The code I have now just outputs a file named "11.png" every time. Can anyone point out what the problem is? Maybe a solution, also... Thanks!
PHP Code:
$file_name=date('m-d-y'); $file_int=$file_name + 1; $image_name=$file_int.'.'.$extension; $newname="images/".$image_name;
|