I have this code that allows my employees to upload resumes into an uploads file on my server, and then everyone can see these resumes who has access to the page, it emails me confirmation that there was a file uploaded, but i need it to also along with uploading it to the specific folder on my server to email the resume as an attachment , i hope someone can help me on this, i have been trying for days moving code around to get it to do it but to no avail, can someone take a look and help me out ???
Code: Select all
<center>
<font face="book antiqua" size="4">
<?php
$target_path = "uploads/";
$path = "A new resume was posted to Accounting under Audit ";
$to = "email@home.com";
$subject = "Resume Added to Database";
$txt = $path;
mail($to,$subject,$txt);
/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
<script>
var redirecturl="acca.php"
var pausefor=1
function postaction(){
if (window.timer){
clearInterval(timer)
clearInterval(timer_2)
}
window.location=redirecturl
}
setTimeout("postaction()",pausefor*1000)
</script>
</font>
Elaine