O'Reilly logo

PHP 5 e-commerce Development by Michael Peacock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integrating reCAPTCHA

reCAPTCHA is a useful tool to prevent automated spam signups. We discussed it in Chapter 14, Deploying, Security, and Maintenance. There are a number of advantages and disadvantages to using this — one advantage being that it helps prevent automated signups, a disadvantage being sometimes they can be difficult to read, and thus act as a barrier to sign up.

The reCAPTCHA website has a PHP library available,http://recaptcha.net/plugins/php/. We need to download this, and sign up for an API key. When we have done this, we simply need to put some code into the signup process.

On the registration page

On the registration page, we require the following code; this includes the library, sets the API key, and adds the reCAPTCHA HTML ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required