php upload and confirmation email

Below is my file upload code and i am wondering how i would send the user a confirmation email once they have uploaded a file. What i want is when they press submit, to get the users email from the database and send them a email confirming they have uploaded a file

[php]<?php

$name = $_FILES[“myfile”][“name”];
$type = $_FILES[“myfile”][“type”];
$size = $_FILES[“myfile”][“size”];
$temp = $_FILES[“myfile”][“tmp_name”];
$error = $_FILES[“myfile”][“error”];
$class = $_POST[‘class’];

if($size > 1000000)
{
die(“The file is too big!”);
}
else {

if (!move_uploaded_file($temp,$class."/".$n… {
die(‘file not uploaded’);
}

}

header(“location: uploadcomplete.html”);

?>[/php]

Here’s a simple tutorial on sending emails with php: PHP Tutorial on Sending Emails

If you still need help after reading that let us know!

You don’t have any security in your file upload either, you’re just asking for trouble with that code. Take a look at this tutorial series to fix that.
http://www.youtube.com/playlist?list=PL10C2E583722F66E7

Sponsor our Newsletter | Privacy Policy | Terms of Service