$now = time();
while(file_exists($uploadFilename = $uploadsDirectory.$now.'-'.$_FILES[$fieldname]
['name']))
{
$now++;
}
Does anybody know how to put this into a variable so i can insert the result into a database?
EDIT:
Sorry, to be a bit clearer:
I need the image filename thats is generated from this while loop into a variable so i can insert that into the database.
for example if i were to upload a file called ‘mypic.png’ it becomes:
1335367953-mypic.
This is the string i need in a variable.
try: