I'm trying to make an upload form that has not only the file on it, but also has an email address and name of the person uploading. I've got a form that has the Name, Email, File slots, but I can't get the PHP to send all the information on the form to the folder in my host's file manager. This is my form code in the website html:
<form action="upload_file.php" method="post"
enctype="multipart/form-data"><br>
<label for="name">Name:</label>
<input name="Name:" id="name" type="text"> <br> <br>
<label for="email">Email:</label>
<input name="Email:" id="email" type="text"> <br> <br>
<label for="file">Select File:</label>
<input name="file" id="file" type="file">
<input name="submit" value="Submit" type="submit"></form>
My PHP as of now, allows images and Word documents to upload only and then forwards you to a thank you page. All of that works fine, but the Name and Email don't go to my upload/ folder as specified. Here is my PHP.
<?php
if ((($FILES["file"]["type"] == "image/gif")
|| ($FILES["file"]["type"] == "image/jpeg")
|| ($FILES["file"]["type"] == "image/jpg")
|| ($FILES["file"]["type"] == "image/png")
|| ($FILES["file"]["type"] == "image/jif")
|| ($FILES["file"]["type"] == "application/msword")
|| ($FILES["file"]["type"] == "image/pjpeg"))
&& ($FILES["file"]["size"] < 1000000))
{
if ($_FILES["file"]["error"] > 0)
{
header( 'Location: http://inizioriders.startlogic.com//sub ... rror.html' ) ;
}
else
{
if (file_exists("upload/" . $FILES["file"]["name"]))
{
echo $FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($FILES["file"]["tmp_name"],
"upload/" . $FILES["file"]["name"]);
header( 'Location: http://inizioriders.startlogic.com//sub ... kyou.html' ) ;
}
}
}
else
{
header( 'Location: http://inizioriders.startlogic.com//sub ... rror.html' ) ;
}
?>
Any suggestions for how to get it to upload everything?
Also, is there a way to get the uploaded files forwarded to an email account or somehow notify me that someone has uploaded something? Thank you!