Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 09-09-2008, 04:36 PM   #1 (permalink)
New Member
 
Join Date: Aug 2008
Location: Utah, USA
Posts: 7
Default Adding upload to a form?

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.
setabkcin is offline   Reply With Quote
Old 10-18-2008, 08:39 AM   #2 (permalink)
New Member
 
Join Date: Oct 2008
Posts: 9
Default

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
Phidev is offline   Reply With Quote
Old 10-29-2008, 04:41 AM   #3 (permalink)
New Member
 
Join Date: Oct 2008
Posts: 2
Default

hope the tutorial : How to create PHP based email form with file attachment
will be helpful for you
prasanthmj is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 02:23 AM.


Computer Forum - TechZine - Webpage Design

 
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.