Help! I have this code, it uploads as it should and it sends the email, what it doesnt do is send the variables in the email so the email is blank ive tried everything to fix i but i cant if anyone can help id be most greatfull! Regards, Ross
<html>
<form enctype="multipart/form-data" action="upload.php" method="post">
<p> Address:
<input type=text name=address>
<br>
Email:
<input type=text name=email>
<br>
name
<input type=text name=mainname>
</p>
<p>File
<input name="userfile" type="file" />
<input name="submit" type="submit" value="Send File" />
</p>
</form>
</html>
php:
<?php
srand(time());
$random1 = (rand()%99999);
$random2 = (rand()%99999);
$random3 = $random1 . $random2;
$file = $_FILES['userfile']['name'];
$content = $mainname;
$content.= "Address: " .$address;
$content.= "Email: " .$emailaddress;
$content.= "ID thingy: " .$file;
set_time_limit(3000);
$uploaddir = 'C:\\inetpub\\clients\\awt969\\';
$uploadfile = $uploaddir . $random3 . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "Done";
mail("me@me.com", "Title", $content);
}
else {
Print "There was an whilst uploading" . $file . "<br>Please email the file to [email]me@me.com[/email]";
}
?>