Results 1 to 1 of 1
on my free web hosting site people sign up with a PHP email form.
ive gotten a few spam emails lately and was wondering, in php is there a way ...
- 12-22-2008 #1
simple captcha in a php email form
on my free web hosting site people sign up with a PHP email form.
ive gotten a few spam emails lately and was wondering, in php is there a way i could set up a captcha, or something they have to enter before the form lets them send it.
the script i currently use is:
php:
and the html to the form is:Code:<?php if(isset($_POST['submit'])) { $to = "deathnerdhosting+test@gmail.com"; $subject = "signup"; $email_field = $_POST['email']; $name_field = $_POST['name']; $pass_field = $_POST['pass']; $message = $_POST['message']; $body = "From: $email_field\n E-Mail: $email_field\n NAME: $name_field\n PASS: $pass_field\n MESSAGE:\n $message"; echo "Your Email has been submitted. Return to http://www.deathnerd.com/index.html"; mail($to, $subject, $body); } else { echo "You cannot access mailer.php directly you must go to signup.html"; } ?>
any help would be greatly appreciated, thanxCode:<table width=200 height=400 border=1> <tr> <td> <h3>SIGNUP</h3> <form method="POST" action="mailer.php"> <tt>Email Address</tt> <br> <input type="text" name="email" size="19"><br> <br> <tt>Desired Account/Website Name</tt> <br> <input type="text" name="name" size="19"><br> <br> <tt>Desired Password</tt> <br> <input type="text" name="pass" size="19"><br> <br> <tt>Questions or a request to have me set up phpbb3 forums on your site.</tt> <br> <textarea rows="7" name="message" cols="25"></textarea> <br> <br> <input type="submit" value="Submit" name="submit"> </form>
Microsoft isn't evil, they just make really crappy operating systems.
Linus Torvalds
Personal and politically centrist blog.--->http://www.deathnerd.com


Reply With Quote