The Are You a Human PHP library allows you to easily add a PlayThru CAPTCHA alternative to forms on your website. It works with POST and GET requests and the workflow is similar to other human-verification solutions (e.g., ReCAPTCHA).
The Are You a Human PHP library requires PHP5.
If you have not already done so, please create an account and add a site on which you plan to have a PlayThru;.
Before you can use a PlayThru, you need to:
Below is a simple example implementation script. It assumes that the AYAH files are in the same folder and that you have already followed the "How to Configure" instructions above.
<?php
// Instantiate the AYAH object.
require_once("ayah.php");
$ayah = new AYAH();
// The form submits to itself, so see if the user has submitted the form.
if (array_key_exists('my_submit_button_name', $_POST))
{
// Use the AYAH object to get the score.
$score = $ayah->scoreResult();
// Check the score to determine what to do.
if ($score)
{
// Add code to process the form.
echo "Hello ".$_POST['name'].", You are a human!";
}
else
{
echo "You are NOT a human!";
}
}
?>
<!-- Build the form tag. -->
<form method="post">
<!-- Build a form field. -->
<p>Please enter your name: <input type="text" name="name"></p>
<?php
// Use the AYAH object to get the HTML code needed to
// load and run the PlayThru.
echo $ayah->getPublisherHTML();
?>
<!-- Include a submit button. -->
<input type="Submit" name="my_submit_button_name" value=" GO ">
</form>
If PlayThru isn't loading for you, please check the following:
If you need further support, head on over to our Support Center. We'd be more than happy to help you out!
If you run into any issues during your installation process please use our support forums. We appreciate all feedback and are ready to help! Follow us on Twitter and Facebook for PlayThru™ updates.