mikes1471 Posted May 22, 2012 Share Posted May 22, 2012 Hey there, I'm trying to make an image upload form which when a file is uploaded will not overwrite an existing file of the same name. Ideally i would like the form to take the Email address of the user and prepend the filename with that, so far the file upload code is as far as I've got and now I'm trying to enter the name, age Email address sections I'm producing errors and confusing myself. I also want it to send me an Email notification with the users information whenever the form has been completed by a visitor. 18427_.php Quote Link to comment https://forums.phpfreaks.com/topic/262948-file-upload-form-adding-more-form-data/ Share on other sites More sharing options...
mrMarcus Posted May 22, 2012 Share Posted May 22, 2012 To ensure filenames are unique you can replace the following: $img_name = $my_email.'~'.$name; with $img_name = md5($name . time()); This will also help keep filenames from being messy (E.g. /images/ThIS Is my File___--That__________I just UpLOADed.jpg) and compatible across the board. Quote Link to comment https://forums.phpfreaks.com/topic/262948-file-upload-form-adding-more-form-data/#findComment-1347735 Share on other sites More sharing options...
mikes1471 Posted May 22, 2012 Author Share Posted May 22, 2012 Awesome thanks Quote Link to comment https://forums.phpfreaks.com/topic/262948-file-upload-form-adding-more-form-data/#findComment-1347784 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.