|
|
#1 (permalink) |
|
New Member
![]() Join Date: Aug 2008
Location: Utah, USA
Posts: 7
|
I have a form already built with php includes and such and all submissions are being sent to a specific email. All the fields are text fields. I need to allow uploads of photos and/or mp3 files to the form. I need them to send with all the form data. How do I add a field for an upload? Also, can I restrict it to certain file types and can I make it a required field? Thanks for the help.
|
|
|
|
|
|
#2 (permalink) |
|
New Member
![]() Join Date: Oct 2008
Posts: 9
|
there is an input type called "file"
in php you will access it with the $_FILE variable. so in your form you will add something like <input type="file" name="media" /> and in the php side you can access it with <? echo "<pre>"; print_r($_FILES['media']) echo "</pre>"; ?> You may want to read the php manual to get the hang of it. and to prevent uploading different file times then you will need to do some parsing with the file name, and compare the extension |
|
|
|
|
|
#3 (permalink) |
|
New Member
![]() Join Date: Oct 2008
Posts: 2
|
hope the tutorial : How to create PHP based email form with file attachment
will be helpful for you |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|