Page 1 of 1

contact form

Posted: Thu Jan 31, 2008 6:59 am
by Aravinthan
Hi,
I have created a contact-us form:
<form name="contactus" action="mail.php" method="post">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
Name:
</td>
<td>
<input type="text" name="name">
</td>
</tr>
<tr>
<td>
Your e-mail:
</td>
<td>
<input type="text" name="email">
</td>
</tr>
<tr>
<tr>
<td>
Subject:
</td>
<td>
<input type="text" name="subject">
</td>
</tr>
<tr>
<td>
Your message:
</td>
<td>
<textarea name="message" rows="15"></textarea>
</td>
</tr>
<tr>
<td>
<input type="submit" name="submit" value="Submit">
<input type="reset" name="reset" value="Reset">
</td>
</tr>
</table>
</form>
mail.php:
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
if(!$mail == "" && (!strstr($mail,"@") || !strstr($mail,".")))
{
echo "$invalid";

}

if(empty($name) || empty($email) || empty($subject) || empty($message)) {
echo "$empty";
}
$invalid = header('Location: http://warfaringwarriors.x10hosting.com/invalid.php');
$empty = header('Location: http://warfaringwarriors.x10hosting.com/empty.php');
$thankyou = header('Location: http://warfaringwarriors.x10hosting.com/thankyou.php');
$headers = "From: \"$name\" <$email>\n";
mail( "clancouncil@warfaringwarriors.x10hosting.com ", "$subject",
"message: $message","</br>", "From: $headers" );

echo "$thankyou";

?>
So I tried testing te form, but i get this error, for thankyoupage, for empty page, for invald page:
Warning: Cannot modify header information - headers already sent by (output started at /home/ara/public_html/mail.php:66) in /home/ara/public_html/mail.php on line 433

Can someone help me please?