|
from contactform.php
<?
/*
Configure this script by putting the following tags in your form:
Note: Your user must enter this value
<input type="text" name="Email"/>
<input type="hidden" name="mailto" value="jenstarbuck@gmail.com"/>
<input type="hidden" name="subject" value="Wedding Website Contact"/>
<input type="hidden" name="return_to" value="contactsubmission.html"/>
The following tags are optional. Use them if you want to send the person who
completed your form an email confirming that they sent it.
<input type="hidden" name="send_thankyou" value="true"/>
<input type="hidden" name="thankyou_message" value="WHATEVER MESSAGE YOU WANT TO SEND TO YOUR CUSTOMER"/>
<input type="hidden" name="thankyou_subject" value="WHATEVER SUBJECT YOU WANT THE MESSAGE TO HAVE"/>
<input type="hidden" name="thankyou_from" value="THE EMAIL ADDRESS YOU WANT TO SEND THE MESSAGE AS"/>
Make sure your form action is "formmail.php", and don't forget to add a submit button!
<form name="theForm" method="post" action="contactform.php">
Enjoy!
Steve Szettella & the 4word systems team.
*/
$keys = array_keys($_REQUEST);
for ($i=0; $i<sizeof($keys); $i++){
$msg = $msg . $keys[$i] .' : '. $_REQUEST[$keys[$i]] ."\n";
}
$to = $_REQUEST['mailto'];
$subject = $_REQUEST['subject'];
mail($to, $subject, $msg, 'From: '.$from);
$thankyouEmail = $_REQUEST['send_thankyou'];
if ($thankyouEmail == 'Y' || $thankyouEmail == 'true' || $thankyouEmail == "TRUE" || $thankyouEmail=="True") {
$thankyou_subject = $_REQUEST['thankyou_subject'];
$thankyou_message = $_REQUEST['thankyou_message'];
$thankyou_from = $_REQUEST['thankyou_from'];
mail($from, $thankyou_subject, $thankyou_message, "From: ". $thankyou_from);
}
$returnTo = $_REQUEST['return_to'];
echo $returnTo;
?>
This seems like a mess to me.
|