PHP upload form

Oct 20, 2010 Author: Beyonce

Hello everyone, this is a simple PHP form for uploading files. We are going to show you how to create form for upload files. If you send an attachment with an email statement should have the attribute "enctype" to HTML element

and to assign the value "multipart / form-data". In this PHP upload form, the client can click the button Browse to shown the dialog window and choose file to upload. Here is the code, and we have give name to the file that we work in. The file name is upload_file.php.
<title> PHP upload form</title</head>
<form action="upload_file.php" method="post"
enctype="multipart / form-data">
<b><i>Please fill out the <strong>PHP UPLOAD form</stron></i></b><br>
<b>To: </b><input type="text" name="to" size="30"> <br>
<b>From: </b><input type="text" name="from" size="30"> <br>
<b>Subject: </b><input type="text" name="subject" size="50">
<textarea cols="60" rows="4" name="comment"></textarea><br><br> <b> Upload file: </b> <input type="file" name="pr" size="30"><br><br> <input type="submit" value="Send"> </form> </body> </html>

views 17465
  1. Add New Comment