HI
All, I have a php form that sends all the info that is filled in to my email.
The thing is I want the person to be able to attach photos to it as well.
The thing is I cant figure out how to do this if some one can help I would well appreciate it.
Below is the php code for the form i have this saved as contact.php this is the file i want the attached file for added two.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Email Form </title>
</head>
<body>
<form method="post" action="sendeail.php">
<!-- DO NOT change ANY of the php sections -->
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
Your Name: <br />
<input type="text" name="visitor" size="35" />
<br />
Your Email:<br />
<input type="text" name="visitormail" size="35" />
<br /> <br />
<br />
Attention:<br />
<select name="attn" size="1">
<option value=" Sales n Billing ">Sales n Billing </option>
<option value=" General Support ">General Support </option>
<option value=" Technical Support ">Technical Support </option>
<option value=" Webmaster ">Webmaster </option>
</select>
<br /><br />
Mail Message:
<br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<input type="submit" value="Send Mail" />
<br />
</form>
</body>
</html>
below is the attached form i want adding to it
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<form>
<table>
<tr>
<td id="parent">
<input type="file" style="display:block" />
<input type="button" id="add" value="Add" />
<input type="button" id="del" value="Remove" />
</td>
</tr>
</table>
</form>
<script type="text/javascript">
var add = document.getElementById("add");
var del = document.getElementById("del");
add.onclick = addFileForm;
del.onclick = removeFileForm;
var elems = Array();
function addFileForm() {
var file = document.createElement("input");
file.style.display = "block";
file.setAttribute("type","file");
elems[elems.length]=document.getElementById("parent").insertBefore(file,add);
}
function removeFileForm() {
if (elems.length>0)
document.getElementById("parent").removeChild(elems.pop());
}
</script>
</body>
</html>
below is the php sucsess page were the person is taken two when they fill in the form, this is saved as sendeail.php
<?php
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
}
echo $badinput;
$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn ;
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor $visitor2($visitormail)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";
$from = "From: $visitormail\r\n";
mail("contactus@highclassescorts.co.uk", $subject, $message, $from);
?>
<p></b><font face="Tahoma" color="#808080" size="2">Date: <?php echo $todayis ?></p>
<p> Thank you <?php echo $visitor ?> ( <?php echo $visitormail ?>
) Your application to become an Escorts is almost complete.
</p>
<p> Please now add a photo to your profile including your name
so we can put the correct photos the the application (These
are for us to look at NOT for the website), email your photos
to <a href="mailto:contactus@highclassescorts.co.uk">contactus@highclassescorts.co.uk
</a></p>
<p>You should now expect to hear from us within a couple of
days. </p>
<p> Thanks again <?php echo $visitor ?> <?php echo $visitor2 ?>
& best regards <br>
From all the team at High Class Escorts</p>
<p> Your IP:<?php echo $ip ?> <br />
<br />
If any one can help I would be more then happy
Thanks from
Patrick