Is that the full code? Because obviously from what I remember you can't just put random HTML into PHP you have to close your PHP code block first if you want to use HTML unless you're using an echo or print statement (I think).
I haven't tried this in a while so thought i'd have a go at it, i'll show you step by step:
1. OK let's tackle your first problem:
When someone presses submit it is suppose to say "Thank you for your interest! Your email will be answered very soon".
OK let's take a simple document and another PHP document to handle the form:
Here is the simple form, save it as form.php:
E-mail Form: (form.php):
Quote
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form name="email" action="handleMail.php" method="post">
Name: <input type="text" name="name" size="20" /><br /><br />
Email: <input type="text" name="sender" width="20" /><br /><br />
Phone: <input type="text" name="phone" width="20" /><br /><br />
Subject: <input type="text" name="subject" size="75" /><br /><br />
Comments: <textarea name="comments" cols="75" rows="5">
Comments
</textarea><br /><br />
<input type="submit" value="Send E-Mail" />
</form>
</body>
</html>
OK now here is the PHP to handle the form save this as handleMail.php:
Quote
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p>Thank you for your interest! Your email will be answered very soon!</p>
</body>
</html>
OK so hopefully now you've saved form.php and handleForm.php. Now open form.php and basically enter nothing in the form and press submit.
Thank you for your interest! Your email will be answered very soon! will be displayed.
How: Because in our form, we say:
action="handleMail.php" which tells it what document to look for to handle the form when the submit button is pressed.
2. OK now i'm going to change handleMail.php to pass on the variables that will be sent by the form. Then i'll display the variables just to show that they have been passed.
Here's the new handleForm.php, so save it over the last one:
Quote
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
//Default
$Webmaster = 'fixthatglitch@hotmail.com';
//assign from form to variables
$name = $_POST['name'];
$sender = $_POST['sender'];
$subject = $_POST['subject'];
$phone = $_POST['phone'];
$body = $_POST['comments'];
//Now let's test they have been passed and show them
echo ("Thanks $name for your response, as outlined below<br /><br />");
echo ("<b>$subject</b><br />");
echo ("\"<i>$body</i>\"<br /><br />");
echo ("We will either contact you via e-mail at: <b>$sender</b> or via phone on <b>$phone</b> within the next 24 hours.<br />");
?>
</body>
</html>
OK now again open form.php, this time enter some dummy data in each of the boxes and press send e-mail. As you can see the variables are passed, and your data should be displayed. If this works correctly move onto the final step
3. Now we know all the data is passing successfully we can now easily send the mail, this is the final handleMail.php:
Quote
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
//Default
$Webmaster = 'fixthatglitch@hotmail.com';
//assign from form to variables
$name = $_POST['name'];
$sender = $_POST['sender'];
$subject = $_POST['subject'];
$phone = $_POST['phone'];
$body = $_POST['comments'];
//Now let's test they have been passed and show them
echo ("Thanks $name for your response, as outlined below<br /><br />");
echo ("<b>$subject</b><br />");
echo ("\"<i>$body</i>\"<br /><br />");
echo ("We will either contact you via e-mail at: <b>$sender</b> or via phone on <b>$phone</b> within the next 24 hours.<br />");
//Join sender e-mail and phone number to create a single header
$headers = "From: ".$sender.", Phone: ".$phone;
//Now send mail
mail ($webmaster, $subject, $body, $headers);
?>
</body>
</html>
As you can see only the 2 lines were added, the first was to create a $headers variable, and the second sends the e-mail. You will need to modify this probably to connect to your e-mail or whatever.
I'd be greatful for any feedback if i've done anything wrong but just trying to learn myself!