PHP Classes

EZ PHP Captcha Script: Validate human users showing an image with a text

Recommend this page to a friend!
  Info   Documentation   Demos   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 112 All time: 9,611 This week: 455Up
Version License PHP version Categories
class_ezcaptcha 1GNU General Publi...5HTML, PHP 5, Validation
Description 

Author

This class can validate human users showing an image with a text.

It can generate an image with a random text that users need to enter in a form text input to confirm they are real human users.

The random text is stored in a session variable, so the class can verify if the user entered the correct text.

The class can also generate HTML and JavaScript for the form to display the validation image.

Picture of MHCSoft Development
Name: MHCSoft Development <contact>
Classes: 2 packages by
Country: United States United States
Age: ???
All time rank: 4220536 in United States United States
Week rank: 197 Up20 in United States United States Up
Innovation award
Innovation award
Nominee: 1x

Documentation

Copy the class_ezcaptcha.php file on your server and replace "<real path to your ttf fonts>" for the real url pointting to the fonts files changin the name of the fonts aswell if you needed. Include the tag <catpcha></captcha> in the html file at the place yuo want to show the captcha. You most include JQuery into your html file and include the following javascript fragment at the end of the html file inside the <script></script> tags. Remember to replace the "<urlto>" for the real url pointting to the class_ezcaptcha.php file (function(){ $.ajax({url:"<urlto>class_ezcaptcha.php?getHtml=1", success: function(result){ $("captcha").html(result); }}); })(); Include the param captcha and his value on your POST or GET param string when you're sending the form http request. Validate the params at your server side code using someting like this: if($_POST['captcha']!=$_SESSION['captcha_code']){return "ERRORcaptcha|Wrong captcha";} Validate the resoults in your ajax/html file after sendig the http request. Enjoy it...

  Demo ezcaptcha External page  
  Files folder image Files (5)  
File Role Description
Plain text file class_ezcaptcha.php Class php code
Accessible without login Plain text file howto Doc. How to
Accessible without login Image file icon Icon image
Accessible without login Image file image Photo image
Accessible without login Image file screenshot.png Photo image screenshot

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:112
This week:0
All time:9,611
This week:455Up