I love Free Software!

Pages

Funny Quotes to Think

When you say "I wrote a program that crashed Windows", people just stare at You blankly and say "Hey, I got those with the system, for free"

-Torvalds, Linus(1995-03-08)-

Tuesday, December 29, 2009

CAPTCHE in PHP email form







Here I am giving a small PHP email program using CAPTCHE verification

Download the reCAPTCHA Library, unzip it, and copy recaptchalib.php to the directory where your forms live 

 
If you don't have API key then sign UP for get key

 
You can modify below php code to match your form


<html>
<head>
<title> CAPCHE verification for email script </title>
</head>
<body bgcolor="#151B8D">
<form action="" method="post">
<!-- Display all fiels in a Table -->
tr><td width=30%>Name<input type = "text" name = "reported" size = "30"></td>
<td width = 20%>Location <input type = "text" name = "location" size = "30"></td></tr>
<tr><td width=40%>Enter Your Email Address</td>
<td width =60%><input type = "text" name = "name" size = "60"></td></tr>
<tr><td width=40%>Comments</td>
<td width=60%><TEXTAREA NAME="comments" COLS=77 ROWS=3></TEXTAREA></td></tr>
is_valid) {
rtsendmail($email,$_POST["name"],$_POST["comments"],$_POST["reported"],$_POST["location"]);
header('Location:thankyou.html');
} else {
header('Location:error.html');
# echo "Error";
}
}
echo recaptcha_get_html($publickey, $error);
?>
<p><input type = "submit" value = "Register">
<input type = "reset" value = "Clear "></p>
</form>
</body>
</html>

No comments:

Post a Comment