I am trying to upload 3 files and send it to a user. I have a file form.php which is as below:
<FORM ENCTYPE="multipart/form-data" ACTION="thnx.php" METHOD="POST">
<p>First Name
<input name="First_Name" type="text" />
</p>
<p>E-mail:
<input name="email" type="text" id="email" />
</p>
<p>Attachment</p>
<p>
<input type="file" name="attachment[]0" />
</p>
<p>
<input type="file" name="attachment[]1" />
</p>
<p>
<input type="file" name="attachment[]2" />
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
In thnx.php the code is as below:
$First_Name = $_POST["First_Name"];
$email = $_POST["email"];
if ($First_Name == "" || $email == "")
{
echo "<span class=gen>One or more fields are not filled in correctly. Please go back and make sure all fields are filled.</span>";
}
else
{
$subject = "Form submitted from Website";
$to = "Me <vipul73@gmail.com>";
$message = "$First_Name has filled the feedback form. His Contact Details are as below:
Name: $First_Name
E-mail ID: $email
";
mail($to, $subject, $message, "From: $First_Name <$email>");
echo "Dear ";
echo $_POST["First_Name"];
echo ",<br> <br>";
echo "Thanks a lot for contacting us. We would get back to you soon.<br><br>";
echo "Vipul";
}
How do I specify
1: Where to upload files temporarily on server (specify folder)
2: How do I attach the files with this mail
3: Delete the temporary files from the server
I desperately need Help 😕