phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


CAPTCHA - part 3 : "Are you human or ....?" (Build Your CAPTCHA)

Tag: captcha, security   Category: PHP Security, PHP Classes
post: 19 Oct 2007 read: 2,726


PHP CAPTCHA Tutorial: Ok, lets we build captcha in our form. First time, we need a captcha class. In this tutorial, we use a captcha class that written by Pascal Rehfeldt. You can download at http://www.phpclasses.org/browse.html/author/102754.html.

1. Another needed in this tutorial, a new directory to practise. Please, create a directory: practice/captcha. <img create a directory>
2. Download captcha file: captcha-2004-05-05.tar.gz.
3. Extract that file to that directory. <img phpspeedo_captcha3_2>
4. Fortune, there is a example file. Try to execute that example: http://yoursite/practice/captcha/example.php You will find like this:
<img phpspeedo_captcha3_3>
Hei, whats matter? Where is image?
5. Be patient, open file captcha.class.php.
6. Look at this line (line 50):
$this->Font      = './hurryup.ttf';
There is no file font in this folder. So We must download before and put that file font to this folder.
7. Download file font from http://www.1001fonts.com/font_details.html?font_id=2366. Mmm.. I try use another font, not hurryup, but Porkys.ttf. <img phpspeedo_captcha3_4>
8. Open file captcha.class.php again. Replace line code:
$this->Font      = './Porkys.ttf';
or change whatever you like.
9. Try execute again:
<img phpspeedo_captcha3_5>


Series this article:
CAPTCHA - part 1 : "Are you human or ....?" (Introduction)
CAPTCHA - part 2: "Are you human or ....?"
CAPTCHA - part 3 : "Are you human or ....?" (Build Your CAPTCHA)
CAPTCHA - part 4 : "Are you human or ....?" (Modify Your CAPTCHA)

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting