Page 1 of 1
Uploading Files in Forms
Posted: Thu Oct 14, 2004 1:58 pm
by scottastrophik
Sami | Help us, help you. Please use Code: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hello all. I am trying to make a form that allows users to send me files through email. I have been using a php form for my other websites that I got from boadrink where all I have to do is change a couple of things. I am finding out that there needs to be more in this form to allow uploads of files. I have no idea about php. Here is what I have in my html form tag:
Code: Select all
<form action="formmail.php" method="post" enctype="multipart/form-data" name="submission" id="submission">
Is there any scripts that allow me to get my form along with a file? I dont know anything about php.
I would greatly appreciate any help that anyone can give me. Thank you.
Posted: Thu Oct 14, 2004 2:08 pm
by Joe
After the form tag you will need to create file fields. Something like:
Code: Select all
<form action="formmail.php" method="post" enctype="multipart/form-data" name="submission" id="submission">
<input type="hidden" name="maxfilesize" value="5000000">
<input name="filename" type="file">
<input type="submit" value="upload file">
</form>
Posted: Thu Oct 14, 2004 2:52 pm
by scottastrophik
Sami | Help us, help you. Please use Code: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Thanks you, but it send me max file size 500000, itdoesnt seem to be working, maybe its my coding. Theres a hole form with it. :
Code: Select all
<form action="formmail.php" method="post" enctype="multipart/form-data" name="submission" id="submission">
<table width="550" border="0">
<tr>
<td><div align="left">Name:</div></td>
<td><div align="left">
<input name="name:" type="text" id="name:">
</div></td>
</tr>
<tr>
<td><div align="left">Email:</div></td>
<td><div align="left">
<input name="email:" type="text" id="email:">
</div></td>
</tr>
<tr>
<td><div align="left">File:</div></td>
<td><div align="left">
їb]<input type="hidden" name="maxfilesize" value="5000000">
<input name="filename" type="file">
<input type="submit" value="upload file">ї/b] </div></td>
</tr>
<tr>
<td><div align="left">Link:</div></td>
<td><div align="left">
<input name="link:" type="text" id="link:" value="http://www.">
</div></td>
</tr>
<tr>
<td><div align="left">Submit to: </div></td>
<td><div align="left">
<select name="select">
<option selected>Photshop Tutorials</option>
<option>Photoshop Brushes</option>
<option>Photshop Styles</option>
<option>Photoshop Gallery</option>
<option>Flash Tutorial</option>
<option>Flash Gallery</option>
<option>Football Helmets</option>
</select>
</div></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><div align="left">Comments:</div></td>
</tr>
<tr>
<td><div align="left"></div></td>
<td><div align="left">
<p>
<textarea name="textarea" cols="35" rows="5"></textarea>
</p>
</div></td>
</tr>
</table>
<br>
<table width="200" border="0">
<tr>
<td><div align="left">
<input type="submit" name="Submit" value="Submit">
</div></td>
<td><div align="right">
<input name="reset" type="reset" id="reset" value="Reset">
</div></td>
</tr>
</table>
<p>
<input name="recipient" type="hidden" value="submission@scottastrophik.com"><input name="subject" type="hidden" value="submission"><input name="redirect" type="hidden" value="completed.htm">
</p>
</form>
Posted: Thu Oct 14, 2004 3:43 pm
by potsed
firstly put the <input type="hidden" name="maxfilesize" value="5000000"> directly under the opening form tag
secondly remove the <input type="submit" value="upload file">
thirdly read the manual about $_FILES @
http://za2.php.net/variables.predefined
Posted: Thu Oct 14, 2004 3:48 pm
by potsed