Can someone please point out to me why this code won't work? The directory is correct and permissions are set to 777 but it still won't work. I don't even get an error, just click SUBMIT and the screen refreshes and displays the text box again.
Thanks is advance for any help.
<?php
if (isset($_POST['submit'])) {
$uploaddir = "test";
if(is_uploaded_file($_FILES['file']['tmp_name'])) {
move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']); }
print "Your file has been uploaded successfully! Yay!";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Upload Form</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" ENCTYPE="multipart/form-data">
File: <input type="file" name="file" size="50">
<input type="submit" value="submit">
</form>
</body>
</html>