Embedded HTML problem in mail script

Greetings,

I am new to this forum and to php scripts. I have (mostly) successfully created my first script, an e-mail script. It has 3 embedded html files in it. I embedded the contact form in the script along with an error page and a thank you page. When I open the "mailer.php page,I see my html form page, but at the bottom of th eform page is the thank you page. And when I purposely create an error that invokes the error page, the error page appears, but at the bottom of the error page is the thank you page.

All html is strict xhtml with css.

This is a hybrid of the Kirupa php contact form script and theSiteWizard.com’s script . I would appreciate any help that I can get. Please let me know if there is any more I need to include. url: http://www.stpeterswestfield.org/php/mailer.php

The e-mail script itself works. I receive e-mails when I use the script/form. I do not know what I have done wrong. Here are excerpts:


Beginning of script to First html Section . . .


<?php
// assigns e-mail address to variable to send form data to
$to = "[email protected]";
// assigns e-mail subject to a variable
$subject = “St. Peter’s Website E-Mail Form”;
// assigns variables to the form’s fields
$name = $_REQUEST[‘name’];
$email = $_REQUEST[‘email’] ;
$about = $_REQUEST[‘about’];
$message = $_REQUEST[‘message’] ;
// assigns variable $body to form fields to compress for mail command
$body = “From: $name
E-Mail: $email
Subject: $about
Message:
$message”;

// checks to see if e-mail field is filled in, if not sends you back to form
if (!isset($_REQUEST[‘email’])) {

// begin form html
?>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd” >
<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“en” lang=“en” >

<head>


And Now The Next Section of Code to HTML . . .


<?php
}
// checks to see if other fields are empty and, if empty, displays error page below
elseif (empty($name) || empty($about) || empty($message)) {

// sends http headers to clear cache to blank form for errors
header( “Expires: Mon, 20 Dec 1998 01:00:00 GMT” );
header( “Last-Modified: " . gmdate(“D, d M Y H:i:s”) . " GMT” );
header( “Cache-Control: no-cache, must-revalidate” );
header( “Pragma: no-cache” );

// begin error html
?>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd” >
<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“en” lang=“en” >

<head>


Next Section of Code


<?php
}
else {
// if no errors, then sends e-mail
mail( $to, $subject, $body);
}

// begin thank you html
?>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd” >
<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“en” lang=“en” >

<head>

<!–rest of thank you html to EOF

last line is:
</html>


End of File