okay, I got the first part taken care of. Now I'm getting a cannot modify header information error. This is what it says:
Warning: Cannot modify header information - headers already sent by (output started at /home/fallons/public_html/Ohio_Email_Form_Test.php:4) in /home/fallons/public_html/Ohio_Email_Form_Test.php on line 37
Can someone take a look at this code and tell me if you can see what I need to do to get it to work?
<html>
<head>
<title>Fallon-Murphy Real Estate</title>
<style type="text/css">
body { font-size: 11pt; background-color: #ffffff; font-family: arial; }
td { font-size: 11pt; font-family: arial; }
.pageTitle { font-size: 18pt; font-weight: bold; }
.redText { color: #cc0153; font-weight: bold; }
.required { font-size: 8pt; }
.smallText { font-size: 10pt; }
.boldText { font-weight: bold; }
.legalText { font-family: Arial; font-size: 8pt; }
.asterisk { color: #990000; font-weight: bold; font-size: 12pt; }
</style>
</head>
<?
if ($selSubject=="SLL"){$SLL="selected";}
elseif ($selSubject=="BYR"){$BYR="selected";}
elseif ($selSubject=="CMT"){$CMT="selected";}
$pass = false;
if ($_POST['submit']){
if(empty($txtEmail)){
$error.="You must supply your email address.<br>\n";
}
if(empty($txaComments)){
$error.="Please provide some questions or comments in order to continue.<br>\n";
}
if($selSubject =="__Select Subject__"){
$error.="Please select a subject.<br>\n";
}
if(!empty($error)){
$form = "form1";
}else{
$pass = true;
header("Location: /Email_ThankYou.htm");
$email="$skdzines@columbus.rr.com";
$subject="Real Estate";
$header = "From: $txtEmail\r\n";
$header .= "X=Mailer: PHP/";
$body="
$txtFName $txtLName
$txtAddress
$txtCity, $txtState $txtZip - $txt4Zip
($txtAreaCode) $txt1Phone-$txt2Phone
Subject: $selSubject
Question/Comments:
$txaComments
";
mail ($email, $subject, $body, $header);
}
}
echo"
<body background='images/linen.jpg'>
<table width='550'>
<tr>
<td width='15%' valign='top' align='center'> </td>
<td width='85%'><div class='pageTitle' style='width: 419; height: 99'><img border='0' src='images/Carlton_Logo%20copy.gif' width='247' height='105'></div>
<p><font face='Times New Roman' color='#990000'><b>At Carlton
Realty, Inc., our guests are important. Please fill out the form below
and we will send you a prompt reply to your questions or
comments. </b></font>
</p>
<p><font face='Times New Roman' color='#990000'><b>Sincerely, </b></font></p>
<p><font face='Times New Roman' color='#990000'><b> Janie M.
Fallon-Murphy, Realtor</b></font></p>
<p class='required'>Items with an <span class='asterisk'><font color='#FF0000'>*</font></span> are required.</p>
</td>
</tr>
<tr>
<td valign='top' align='center'> </td>
</tr>
</table>
<form method='POST' action='$PHP_SELF' name='form1'>";
if (!empty($error)) {//if there is any error message, print it to the screen
echo "<font face='Verdana, Arial, Helvetica, sans-serif' size='1' color=#990000><b>The following problems occurred:</b><br /></font><font face='Verdana, Arial, Helvetica, sans-serif' color=#990000 size=1>\n";
print ("$error");
}
echo"
<table width='560' cellspacing='3' cellpadding='4' border='0'>
<tr>
<td width='25%'> </td>
<td>
<span class='asterisk'><font color='#FF0000'>*</font></span>Email Address <span class='smallText'>(Complete address required for follow-up.<br>
e.g. <a href=''>johnsmith@email.com</a> ):</span><br>
<input NAME='txtEmail' type='text' value='$txtEmail' SIZE='30' maxlength='75'>
</td>
</tr>
<tr>
<td width='25%'> </td>
<td>
First Name:<br>
<input NAME='txtFName' type='text' value='$txtFName' SIZE='25' maxlength='20'>
</td>
</tr>
<tr>
<td width='25%'> </td>
<td>
Last Name:<br>
<input NAME='txtLName' value='$txtLName' SIZE='30' maxlength='25'>
</td>
</tr>
<tr>
<td width='25%'> </td>
<td>
Street Address:<br>
<input NAME='txtAddress' value='$txtAddress' SIZE='30' maxlength='75'>
</td>
</tr>
<tr>
<td width='25%'> </td>
<td>
City:<br>
<input NAME='txtCity' value='$txtCity' size='30' maxlength='25'>
</td>
</tr>
<tr>
<td width='25%'> </td>
<td>
State:/Province: <small>(Use 2-character abbreviation) </small> <br>
<input NAME='txtState' value='$txtState' SIZE='5' maxlength='2'>
</td>
</tr>
<tr>
<td width='25%'> </td>
<td>
Zip/Postal Code:<br>
<input NAME='txtZip' value='$txtZip' Size='6' maxlength='6'>
-
<input NAME='txt4Zip' value='$txt4Zip' Size='4' maxlength='4'>
</td>
</tr>
<tr>
<td width='25%'> </td>
<td>
Daytime Phone:<br>
(
<input NAME='txtAreaCode' value='$txtAreaCode' SIZE='3' maxlength='3'>
)
<input NAME='txt1Phone' value='$txt1Phone' SIZE='3' maxlength='3'>
-
<input NAME='txt2Phone' value='$txt2Phone' SIZE='4' maxlength='4'>
</td>
</tr>
<tr>
<td width='25%'> </td>
<td>
<span class='asterisk'><font color='#FF0000'>*</font></span>Subject:<br>";
echo("<select name='selSubject' size='1'>
<option selected>__Select Subject__</option>
<option value='SLL' $SLL>Interested Seller</option>
<option value='BYR' $BYR>Interested Buyer</option>
<option value='CMT' $CMT>Comment</option>
</select>");
echo"
</td>
</tr>
<tr>
<td width='25%'> </td>
<td valign='top'>
<span class='asterisk'><font color='#FF0000'>*</font></span><span class='boldText'>Questions/Comments</span><br>
<textarea cols='50' name='txaComments' rows='8' wrap='virtual' value='$txaComments'></textarea>
</td>
</tr>
<tr>
<td width='25%'> </td>
<td valign='top' align='center'>
<input name='submit' TYPE='Submit' VALUE='Send'>
<input TYPE='Reset' VALUE='Clear' name='reset'></td>
</tr>
</table>
</form>
</body>
</html>";
?>
I have been having a hard time with these header errors in other scripts I have done.
Thanks