$_FILES is empty
Posted: Tue Jun 24, 2008 5:27 am
I am writing a simple file upload script and seem unable to receive the uploaded file. My script is simple:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>File Upload Form</title>
</head>
<body>
This form allows you to upload a file to the server.<br>
<form action="<?=$me?>" method="post"><br>
Type (or select) Filename: <input type="file" name="userfile"><input type="submit" value="Upload File">
</form>
<?php
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
echo "GET method";
}
else {
print_r($_SERVER);
echo '<br />';
print_r($_FILES);
}
?>
</body>
</html>
My hosting service says there's an error with my script - I don't see it. This is the first time I've tried file upload on their systems.... Where's my error?
thanks in advance
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>File Upload Form</title>
</head>
<body>
This form allows you to upload a file to the server.<br>
<form action="<?=$me?>" method="post"><br>
Type (or select) Filename: <input type="file" name="userfile"><input type="submit" value="Upload File">
</form>
<?php
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
echo "GET method";
}
else {
print_r($_SERVER);
echo '<br />';
print_r($_FILES);
}
?>
</body>
</html>
My hosting service says there's an error with my script - I don't see it. This is the first time I've tried file upload on their systems.... Where's my error?
thanks in advance