Hi,
I made a script so that users can enter articles, headlines, etc. and upload pictures for a newspaper site. The text information will eventually be stored in a mySQL database and the pictures will be copied to a directory. The problem arises with uploading the pictures.
The form:
<FORM METHOD="POST" ACTION="submit.php" enctype="multipart/form-data">
Picture 1: <INPUT TYPE="file" NAME="picture1"><br>
<INPUT type="hidden" NAME="MAX_FILE_SIZE" value="1000000">
<INPUT TYPE="submit" NAME="submit" value="Submit">
</FORM>
The upload script:
$pic1 = $_FILES["picture1"];
function copy_pics($pic,$img_var,$date)
{
if($pic!="")
{
copy($_FILES[$img_var]["tmp_name"], "D:\\web\\images\\".$date.$_FILES[$img_var]['name']) or die("Error copying file.");
echo $_FILES[$img_var]["name"]." (".$_FILES[$img_var]["size"]."bytes) of type, ". $_FILES[$img_var]["type"].", successfully uploaded.";
}
else
{
echo "Input file unavailable.";
}
}
When I run the script, "Input file unavailable." is what shows up. What am I missing?