I am having a hard time attaching footer to my document the footer attaches ok when the message is sent, but if there is error it doesn’t attach footer
(header, body, blah blah (I skipped that part)
<div class="main_window" id="content_bg"><p><br>
<div id="php">
<?php
if(isset($_POST['submit'])) {
$to = "blah@gmail.com";
$subject = "web form";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$body = "From: $name_field
E-Mail: $email_field
Message:
$message";
if (!eregi ('^[[:alnum:]][a-z0-9_\.\-]*@[a-z0-9\.\-]+\.[a-z]{2,4}$', stripslashes(trim($_POST['email']))))
{
echo '*wrong email;
exit;
}
$headers = "From: $email";
mail($to, $subject, $message, $headers);
echo "message sent: $to!";
mail($to, $subject, $body);
} else {
echo "Oops!";
}
?>
<?php include("footer.php"); ?>