I have the following code... My issue is I have submited this form about ten times and have not recived and E-mail to the current address below any ideas?
If someone could look this over and let me know.
Thanks!
[PHP]<?php
require_once ("conversionTable.php");
// extract the email address. Since this is validated it will be present
$email_to = $_POST['chrisj951@yahoo.com'];
$email_text = '';
$email_subj = 'Special Offer Form';
$email_hdrs = '';
// -----------------------------------------------------------------------------
// Process each heading and its form name arrays and store the formatted
// overview in the variable $email_text.
// -----------------------------------------------------------------------------
foreach($Headings as $heading => $formnames) {
// print the heading line
$email_text .= "<br> <br>$heading:";
// now loop through the formnames sub-array and print the field name and its value
foreach ($formnames as $fieldname) {
$fieldvalue = htmlentities($_POST[$fieldname]);
if (array_key_exists($fieldname, $conversion_table)) {
$tabel = array();
for ($i=0; $i<count($conversion_table[$fieldname]);$i++) {
array_push ($tabel,$conversion_table[$fieldname][$i] );
}
$label = $tabel[0]; // set description
if ($label <> "ignore") { // field to be ignored?
if ($tabel[1] == "*") // get value from $_POST array value?
$answer = $fieldvalue; // yes: get value from $_POST array
else { // no: get value from conversion table
$ents = (count($tabel)-1)/2; // no of 2-part entries
for ($j=0,$i=1; $j<$ents; $j++,$i+=2) {
if ($fieldvalue == $tabel[$i]) { // compare value (1st part)
$answer = $tabel[$i+1]; // true: get value from 2nd part
break; // break out of FOR loop
} // End IF
} // End FOR
} // End ELSE
} // End IF <> ignore
} // End IF array_key_exists
else { // name not in conversion table:
$label = $fieldname; // display form name
$answer = $fieldvalue; // and form value
} // End ELSEIF array_key_exists
if ($label <> "ignore" && $answer != "") {
$email_text .= "<br> ".$label." : ".$answer;
$answer = "";
} // End IF <> ignore
} // End FOREACH ($formnames)
} // End FOREACH ($Headings)
// ================================================== =============================
// Now all information is stored in the $email_text variable. Handle it
// ================================================== =============================
if ($email_text == "")
echo "<p style='font-family:tahoma;font-weight:bold;text-decoration:underline;font-size:14px;'>No form input to send</p>";
else {
// print the information on the screen
echo "<p style='font-family:Tahoma;font-size:12px;'>$email_text</p>";
// build and send the information in an e-mail message
// translate the indentation chars to blanks and the breaks to newlines
$email_text = str_replace(array("<br>", " "), array("\n", " "), $email_text);
$email_subj = "This is a confirmation of your aFe purchase";
$email_hdrs = "From: ronald@goosen-verdonk.nl\n";
if (mail($email_to, $email_subj, $email_text, $email_hdrs))
echo "Mail successfully sent";
else
echo "Mailing error!";
}
?>
[/PHP]