I have a basic problem here. I am new to PHP and I am developing a response page that will notify the end user if they have not entered information into a certain field. But, I cannot get the form to exit to another page, once all of the fields have been entered.
Any advice would be appreciated. Thank you, and you have an outstanding resource here.
<body>
<?
$mailto = "emz@kepharttrucking.com";
if ($submit) {
if (!$name) {
$error = "Sorry! You failed to fill in the <b>name</b> field!<br>";
echo $error;
} if (!$email) {
$error2 = "You failed to enter an <b>email address</b>!";
echo $error2;
}
elseif ($name && $email) {
echo "Your Mail has been sent<br><br>";
echo "Return to the Home Page";
$message= "Contact form\n\n";
$message.= "From $name at email address: $email\n";
$message.= "$body\n";
mail($mailto, $subject, $message, "Return-Path: testsend\nFrom: $email\nReply-To: $email\n");
}
?>
<p>
<Form action="<?php echo $PHP_SELF ?>" method="post">
<input name="subject" type="hidden" value="Feedback Form"><br>
<p>Form #2<Br></p>
<font color="red" size="2">Required</font><br>
Name:<br>
<input name=name size=30 value="<? echo($name); ?>"><br>
<font color="red" size="2">Required</font><br>
Email Address:<Br>
<input name=email size=30 value="<? echo($email); ?>"><br>
<font color="red" size="2">*Required</font><br>
<textarea cols="50" name="body" rows=10>---Enter your message here---</textarea></br>
<input name="submit" type="submit" value="Submit">
</form>
</p>
<?php
}
?>
</body>