Simple Anti-Spam Captcha

by Bhumi //Nov 17,2012 // 1 comment.

Simple Anti-Spam Captcha
Share This:Share on FacebookShare on LinkedInTweet about this on TwitterShare on Google+Share on RedditBuffer this pageDigg thisEmail this to someoneFlattr the authorShare on StumbleUponShare on TumblrPin on Pinterest

If you are looking for simple and easiest CAPTCHA code using PHP. In this tutorial I am going to explain how to implement own CAPTCHA in PHP with use of some existing image functions in PHP for creating an image.

A CAPTCHA is a random string which is basically used to protect website from spam.Here I am going to show you the one of the easiest CAPTCHA code and you can easily add into your site. Here I have generate a character with using some string functions and loop.

Next,place below code and here I have defined png image to create a CAPTCHA but you can use jpeg,bmp and gif also. In header, ‘Content-Length‘ will be png if you are going to use imagepng and jpeg, if imagejpeg.In imagecreate function, you need to pass own width and height for image.

Now, When submit CAPTCHA code, have to validate captcha text entry and without validation, CAPTCHA is useless. so to validate CAPTCHA, first we take CAPTCHA code into SESSION variable and compare it with the user entered text passed as POST data.

That’s it.What do you think is this easiest technique I’ve mentioned above? Why or why not? Share your thoughts and questions in the comments.

Thanks for reading and feel free to share your thoughts, don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

RELATED POST

Method Chaining in PHP

Share This: Method Chaining is the new feature of object-oriented approach introduced in PHP5.Today I am going to explain how to use method chaining in READ MORE

To create zoho leads using PHP

Share This: Today i am going to explain about how to create zoho leads from php. Zoho provide online lead management system.Zoho leads take details READ MORE

Webservice in WordPress

Share This: Here i am going to explain new article about how to call webservice in wordpress. Webservices are useful to retrieve your contents ftom READ MORE

Clean HTML content in PHP

Share This: After a long long time i get time to write article and i am curious to write but didn’t get time. So, Today READ MORE

Convert RGB to Hex HTML code in PHP

Share This: Here, I am going to explain code which is used to get HTML Color Code from RGB( RGB stands for Red, Green, and READ MORE

Feedback One

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 6 = twelve

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">