What's new

php upload site

  • Thread starter Call me LEWY
  • Start date
  • Views 461
Call me LEWY

Call me LEWY

Maybe?
Forum Addict Grammar Nazi Mr. Nice Guy
Messages
3,961
Reaction score
597
Points
515
Sin$
7
im trying to make an easy upload site with php but im having trouble with it.

heres the code:
Index.php
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload:
<BR>
<input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
uploader.php
// Where the file is going to be placed
$target_path = "uploads/";

/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

move_uploaded_file.php
$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}

But i get errors, see for yourself and upload something:

http://7suploadsite.0fees.net

i made that domain just to upload the site and test.
 
Top Bottom
Login
Register