Hi i'm currently having problems with my code.
When i submit the form with the CAPTCHA Code submited it sends the email, but when i dont enter the code it still submits the form.
Can you tell me what i'm doing wrong.
thanks
<?php
session_start();
?>
<form action="contact.php" method="post">
<?php
if ($_POST["send"]<>'') {
if( $_SESSION['validation'] == $_POST['validation'] {
$ToEmail = 'email@yourwebsite.com';
$EmailSubject = "Contact form ".$_POST["about"];
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY = "Name: ".$_POST["name"]."<br>";
$MESSAGE_BODY .= "Email: ".$_POST["email"]."<br>";
$MESSAGE_BODY .= "Comment: ".nl2br($_POST["comment"])."<br>";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
echo "Your message was sent.";
unset($_SESSION['security_code']);
} else {
echo "Invalid Security Code";
}
else {
?>
<br />
<br />
<table width="400" border="0" cellspacing="2" cellpadding="0">
<tr>
<td width="29%" class="bodytext">Your name:</td>
<td width="71%"><input name="name" type="text" class="textbox" id="name" size="32"></td>
</tr>
<tr>
<td class="bodytext">Email address:</td>
<td><input name="email" type="text" class="textbox" id="email" size="32"> </td>
</tr>
<tr>
<td class="bodytext">Message:</td>
<td><textarea name="comment" cols="45" rows="6" id="comment" class="textbox"></textarea></td>
</tr>
<tr>
<td class="bodytext"><img src="CAPTCHA/?width=100&height=35&characters=5" class="textbox" /></td>
<td align="left" valign="top"><input name="validation" type="text" class="textbox" id="validation" /></td>
</tr>
<tr>
<td class="bodytext"> </td>
<td align="left" valign="top"><input name="send" type="submit" class="button" id="send" value="Send Email »"></td>
</tr>
</table>
<p>You will receive a reply to the email address you specify from the administrator.
<br />
Thank you for the time you have take to fill out this form.</p>
</form>
<?php
};
?>