Okay, I have been wracking my head all day on this one. I made a really simple page to upload a file (submitting to PHP). I have attached the page and script. I put in a print_r command to see the array dump of the HTTP_POST_VARs. Everytime, the array prints nothing. If I change the type=file to type=text, it will print the post vars... but that doesnt do much good. I'm guessing there is something I need to set on my server... the file and directory are CHMOD777.
Any other ideas?
Page:
<HTML>
<body>
<B>File upload</b>
<form enctype="multipart/form-data" action="<?php print $PHP_SELF; ?>" method="post">
Send this file:
<input name="userfile" type="file"><br>
Name:<input name="filename" type="text"><br>
<input type="submit" name="submit" value="Send File"><hr>
</form>
</body>
<?PHP
print_r ($HTTP_POST_VARS);
$dir="/home/users/web";
if ($userfile){
copy($userfile,$dir.$userfile_name);
if (!is_uploaded_file ($userfile)){
echo "<b>$userfile_name</b> couldn't be copied !!";
}
}
if (is_uploaded_file ($userfile)){
echo "<b>$userfile_name</b> copied succesfully !!";
}
?>
</html>