PHP Classes

File: howto

Recommend this page to a friend!
  Classes of MHCSoft Development   EZ PHP Captcha Script   howto   Download  
File: howto
Role: Documentation
Content type: text/plain
Description: How to
Class: EZ PHP Captcha Script
Validate human users showing an image with a text
Author: By
Last change: comment added
Date: 3 years ago
Size: 1,057 bytes
 

Contents

Class file image Download
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...