Need to add a basic Captcha Script to a contact us page
Posted: Fri Oct 29, 2010 6:54 am
Hi,
I'd like to add a captcha text to a contact page. It has only fourfields, name, email address, how did you hear about us (radio buttons), and a feedback textbox.
I used an online site to create the php script, so that when a user clicks the submit button it goes to feedback.php. However, I want some validation done for these four fields and the captcha and only if it passes, should i move onto feedback.php. At feedback.php if all goes well, it redirects again to thankyou.php.
So what I need is validation for my four fields + add a basic captcha on the contactus.php page itself and continue on to feedback.php if all is well..
Can someone please help?
thanks
Jongleur
I'd like to add a captcha text to a contact page. It has only fourfields, name, email address, how did you hear about us (radio buttons), and a feedback textbox.
I used an online site to create the php script, so that when a user clicks the submit button it goes to feedback.php. However, I want some validation done for these four fields and the captcha and only if it passes, should i move onto feedback.php. At feedback.php if all goes well, it redirects again to thankyou.php.
So what I need is validation for my four fields + add a basic captcha on the contactus.php page itself and continue on to feedback.php if all is well..
Can someone please help?
thanks
Jongleur
Code: Select all
<form method=post action="/feedback.php">
<div id="adm-content">
<div id="generic-font">
<table width=440 border=0 cellspacing=10 cellpadding=0>
<tr>
<td valign=top align=left>
Please use form below to write to us.
</td>
</tr>
<tr>
<td valign=top align=left>
<b>First Name:</b><br>
<input type=text name="name" size=25></td>
</tr>
<tr>
<td valign=top align=left>
<b>Email:</b><br>
<input type=text name="email" size=25></td>
</tr>
<tr>
<td valign=top>
<b>How did you hear about us?</b><br>
<input type=radio name="fromwho" value="A popular search engine">A popular search engine<br>
<input type=radio name="fromwho" value="Link from another site">Link from another site<br>
<input type=radio name="fromwho" value="From a friend">From a friend
</td>
</tr>
<tr>
<td colspan=2> </td>
</tr>
<tr>
<td colspan=2 valign=top align=left>
<b>Please write your query / comment / suggestion in the box below:
</b><br>
<textarea cols=70 rows=10 name="comments"></textarea>
<p>
<input type="submit" value="Send Message">
<input type="reset" value="Clear the form"></td>
</tr>
</table>
<!-- Option 2 -->
<INPUT TYPE="hidden" NAME="success" VALUE="http://www.mysite.com">
<input type="hidden" name="required_fields" value="Name,email">
</div></div><!-- end #contactus-content-->
</form>