I ben i need some help with a file upload script i can't seem to get it to work. I emailed my host and everything is enabled to allow file uploads threw php but everything i try won't work.
Here's my form i'm using.
Code:
<form method=\"post\" action=\"upload2.php\">
<p>Choose a screenshot to upload:</P>
<p><input type=\"file\" name=\"file\" id=\"file\"></p>
<p><input type=\"submit\" name=\"submit\" value=\"Upload\"></P>
</form>
Here's the upload script i took it right from the php manual to test it out.
Code:
$uploaddir = '/home/viperweb/public_html/bobs/uploads/';
$uploadfile = $uploaddir . $_FILES['file']['name'];
if(copy($_FILES['file']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded.";
} else {
print "Possible file upload attack!";
}
All i get is either a blank screen or Possible file upload attack. It won't upload the file. I chmoded the folder to 777 and everthing i can think of but nothing will work.
Thanks
Viper