Hi !
I want to assign unique names to my uploaded photos.
As i am sending two images in the same time, in the same form, i would like to ask if the method i am using :
- date("U") + HTTP_X_FORWARDED_FOR
Do the job of assigning unique names even that two files are being sent from the same form?
To prevent the two files being overrided and stored as just one file .
The date("U") format assign unique timestamp?
If not wich method can i use?
Here is my code:
$ext = strrchr($_FILES['thephoto']['name'], '.');
$FILES['thephoto']['name']=date("U").$SERVER[HTTP_X_FORWARDED_FOR].".".$ext;