Jump to content

File Upload form, adding more form data


mikes1471

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.