My site, http://www.unlimitedwealth.biz/questions.php has a few issues. When the form is filled out, and submitted, a thankyou is suposed to appear on the page, so there is something whing with my php coding.
Here's my logic.
html stuff that never changes...
<?=$errormessage?>
<?php
if ($_POST['submit']) {
$required_fields = explode(",", $_POST['required']);
$error = 0;
foreach($required_fields as $fieldname) {
if ($_POST[$fieldname] == "") {
$error++;
}
}
if ($error == 0) {
if (strstr($_POST['sender_email'], "@") and strstr($_POST['sender_email'], ".")) {
mail("unlimitede@optonline.net" , "Message from Web Form (Question)", $_POST['questions'], "From: $_POST[sender_name] <$_POST[sender_email]>");
print "<p align=center>Thank you for submitting your question $_POST[sender_name]!</p>";
exit;
} else {
$errormessage = "<b>The email address you entered does not appear to be valid<br></b>";
}}
} else {
?>
form...(html code)
<?php
}
?>
footer...(html code that never changes)
Thanks for your help, so if somone can clue me into the error in my logic that would be supper. 😉