FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Upload Script





NG
Step 1
Add this form in between your <body></body> tags:

Code:
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
Select a file <input type="file" name="userfile"><br>
<input type="submit" value="Upload!">
 

Step 2
Open a new file and copy the below code and save it as upload.php


Code:
<?php

if(!(copy($_FILES['userfile']['tmp_name'], "Upload/" . $_FILES['userfile']['name']))) die("Cannot upload files.");

echo "Upload Complete!";

?>
Ranfaroth
Some errors :
form elements can't have directly inline elements (like input). You need a block element (like fieldset)
Don't use copy for moving your file : you should use move_uploaded_file.
You should also use is_uploaded_file for security.
Related topics
looking for wap upload script
Upload Script
quite simple file upload
Upload Script
php upload issue
Upload a preset file using PHP
I need a php upload script, NEEDED BADLY
Mail attachment script???
File upload problem :'(
image upload, and return url to image
Upload Script
[RESOLVED] phpbb Help with making an upload script.
www.imagegarage.net
How to do an upload script??
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.