Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate:
Integrating Googles new reCAPTCHA in PHP
Dec 17, 2014 @ 15:23:10

Recently Google announced their reCAPTCHA without a CAPTCHA technology to help make preventing automated systems (usually spammers) from causing issues in your applications. In this new post from Sameer Borate, he shows you how to implement this new kind of CAPTCHA in your PHP-based application.

For the past several years Google’s reCAPTCHA has helped verify that a user is not a bot by forcing you to decipher warped text. reCAPTCHA’s method of protecting websites from spam has always been a kind of burden on the end user who has to solve the captcha to prove that he is human and not a bot. [...] Google recently released a new captcha API called “No CAPTCHA” reCAPTCHA, which utilizes an Advanced Risk Analysis engine that is capable of discerning between users and bots. So instead of solving a jumbled box of text all a user has to do is check a box.

He walks you through the full process of the integration:

  • Signing up for an account/API keys
  • Rendering the HTML for the actual widget (using Google Javascript)
  • Validating the user's response via an API call
  • The PHP you'll need to perform the validation

He also briefly mentions some of the customization available and provides the code as a download so you can see it all working together.

tagged: google captcha nocaptcha recaptcha api tutorial configure setup

Link: http://www.codediesel.com/security/integrating-googles-new-nocaptcha-recaptcha-in-php/

SitePoint PHP Blog:
Simple Captchas with PHP and GD
Mar 07, 2014 @ 18:05:38

On the SitePoint PHP blog there's a new post by Mahul Jain looking at a simple way to create CAPTCHA images in PHP using the built-in GD libraries.

By now, we’ve all encountered captcha images in online forms. Captchas are a necessary evil, and this article will teach you how they’re made. Please note that while there are better, automatic third party solutions for captchas out there such as ReCaptcha, this tutorial aims merely to explain and demonstrate how such technology actually works. We won’t be explaining what captchas actually are, as it’s assumed to be common knowledge and already covered in greater detail elsewhere.

He walks you through the whole process of making the sample CAPTCHA (like this one):

  • Display an empty image on the browser
  • Create a shape
  • Generate random lines
  • Generate random dots
  • Generate random text

There's screenshots all along the way too for reference as to what your result should look like. You can download the full code over on GitHub.

tagged: captcha gd tutorial introduction

Link: http://www.sitepoint.com/simple-captchas-php-gd/

DevShed.com:
Asirra Captcha PHP Integration
Jul 29, 2010 @ 15:36:28

On DevShed.com today there's a new tutorial about implementing the Asirra CAPTCHA system (from Microsoft) into your application for spam prevention.

Unlike other types of captcha that utilize difficult text obfuscation techniques (such as Google reCaptcha), this system utilizes images of dogs and cats, such as those shown in this screenshot.

They describe some of the reasons to use the system (hard to break, doesn't use sessions, easy to integrate) and how it works. They show how to implement the system on both the server and client side.

tagged: asirra captcha tutorial integrate spam

Link:

phpDevelopment Blog:
Zend Framework Tutorial Series: Part 3 – Login and Signup with (RE)Captcha
Jul 13, 2010 @ 17:30:32

In a new post to his phpDevelopment blog Andrei Gabreanu has added the third part of his Zend Framework tutorial series. This time he looks at using a CAPTCHA image in your form via a call to a Zend_Captcha component.

he third part of the tutorial series will present you with a fully functionable solution for a login and signup page that activates a RECaptcha, via Zend_Captcha as a Service, when the user attempts to login/signup 3 times and fails. The tutorial will also show you how to use your models and how to structure your business logic inside your module based application.

They help you set up the database configuration information, create a sample layout for the page, work with the authentication and users controllers and, of course, the form. The inclusion of the CAPTCHA is as easy as adding a Zend_Form_Element_Captcha to the Zend_Form instance and setting up the user/signin process.

tagged: zendframework login signup tutorial captcha

Link:

PHPBuilder.com:
Create a CAPTCHA Script with PHP
Jan 06, 2010 @ 17:49:52

On PHPBuilder.com today there's a new tutorial posted helping you create a simple CAPTCHA image you can use in your forms to help to somewhat secure them from scripts out there that might abuse them.

CAPTCHA protection is used on web site forms and works by generating a random string, writing it to an image, then storing the string inside of a session. Then, the site checks the CAPTCHA when the form is submitted. In this article, you will learn how to make your own simple CAPTCHA image using PHP. You will create the CAPTCHA image step by step.

Their example uses numbers, lowercase letters and a few other characters to create the distorted image. The tutorial shows you how to take this character set, pull out a few randomized values and push them into a dynamically created image with PHP's built-in GD functionality. They also include a brief script showing how to use it in the form for validation of the submission.

tagged: captcha tutorial gd image

Link:

The Tutorial Blog:
Adding security to CodeIgniter forms with a custom library class
Dec 17, 2009 @ 14:15:41

On The Tutorial Blog today they've shared a library that you can use on your CodeIgniter application to help give your forms a bit more security - a math problem "captcha".

The class that we are going to create within CI will simply add a math question that the user will have to enter correctly to continue. This is useful to stop bots from mass submitting information to your forms. The class we are going to write is only very short and simple, but it will give you an idea of how to create classes for your own projects.

Their class creates two random numbers to be used for the question, displays the question the user should answer (Ex. "What is 2 + 4?") and sets the answer in the flashdata, ready for the page submit. When the controller reloads, the answer the user gave and the one from the flash are compared as a part of the standard form validation rules.

tagged: codeigniter framework tutorial captcha addition

Link:

NETTUTS.com:
Build Your Own Captcha and Contact Form
Jun 11, 2009 @ 18:39:48

NETTUTS.com has posted a new tutorial on how to create and use your own CAPTCHA image to help protect the submission of your form.

Ever get hit with spam through the contact form on your personal site? Well, here is a short tutorial on how to build a custom captcha to keep the bad guys out.

The tutorial's broken up into eight steps:

  • captcha.php and the Session
  • Random String
  • Storage Folder and Colors
  • Building the Image
  • Image Final
  • contact.php
  • HTML & CSS
  • Validate

Plenty of screen shots and example code/HTML/CSS are included.

tagged: form contact tutorial captcha

Link:

DevShed:
Designing a Captcha System with PHP and MySQL
Jun 05, 2009 @ 13:49:15

On DevShed's PHP section today there's a new tutorial focusing on the creation of a CAPTCHA image to help prevent spam on the forms (and other input methods) of your website.

Spam is one of the biggest problems on the Internet. It is getting harder to fight with the advent of spam bots that visit websites and automatically fetch email addresses, fill out forms and do other nasty things, such as blog spam comments, that could degrade your integrity. Fortunately, using captcha can help. This article will show you how to implement captcha on your site.

CAPTCHA images are those small images, usually at the bottom of forms, that have distorted letters and numbers in an effort to prevent anything not human from submitting the form correctly. They're usually accompanied by a form field asking for the letters/numbers displayed in the image. In the tutorial they use PHP's built in GD support to create a script that builds the image from an inputted string.

They also give an option for a GD-less version, but it's not nearly as dynamic and wouldn't help as much as the image generated on the fly.

tagged: tutorial gd mysql captcha

Link:

NETTUTS.com:
9 Extremely Useful and Free PHP Libraries
Apr 09, 2009 @ 12:51:16

NETTUTS.com has posted a list of nine libraries you can use to quickly and easily add functionality to your web application.

A lot of functionality is shared among applications - like sending emails or preventing spam. In the spirit of reusing the wheel instead of reinventing it, here are nine free web libraries that you can use in your next program which will dramatically increase your efficiency.

Here's their list:

Screenshots (and code examples) are provided for several of the items as well as links to their website and documentation pages.

tagged: useful library list captcha aksimet json chart xmlrpc amazon s3 mail

Link:

WebReference.com:
User Personalization with PHP: The Verification Code
Mar 17, 2009 @ 14:37:50

WebReference.com continues their look at user personalization with the second part of the series - how to validate that the users signing up for your site are valid. (Here's part one, the introduction).

In this article, we will be looking at user authentication. User authentication simply means verifying that a particular user has the right to access a part of our application. Because our application deals with user preferences, access control is even more pertinent especially since multiple users are going to try to access this application at any given time.

As a part of this user validation and customization, they need to create a form that non-human scripts have a harder time using (hopefully weeding them out and getting better user information). The article steps you through a few lines of code that you can use to create a simple image of a four-digit number whose value is placed in a session variable so it can be validated on submission of the form.

tagged: captcha image validation user personalization gd random digit

Link:


Trending Topics: