<?php

/**
Securimage Test Script
Version 1.0 - 01/02/2008

Upload this PHP script to your web server and call it from the browser.
The script will tell you if you meet the requirements for running Securimage.

http://www.phpcaptcha.org
*/


if (isset(Array['testimage']) && Array['testimage'] == '1') {
  
 imagecreate(225225);
  
 imagecolorallocate(255255255);
  
 imagecolorallocate(000);
 
  
   imagecolorallocate(255,   0,   0);
  
 imagecolorallocate(,   0255,   0);
  
  imagecolorallocate(,   0,   0255);

  
// draw the head
  
imagearc(100120200200,  0360);
  
// mouth
  
imagearc(10012015015025155);
  
// left and then the right eye
  
imagearc(,  60,  95,  50,  50,  0360);
  
imagearc(140,  95,  50,  50,  0360);

  
imagestring(5151'Securimage Will Work!!');
  
imagestring(2520':) :) :)');
  
imagestring(2530':) :)');
  
imagestring(2540':)');

  
imagestring(215020'(: (: (:');
  
imagestring(216830'(: (:');
  
imagestring(218640'(:');

  
imagepng(null3);
  exit;
}

function 
print_status()
{
  if (
) {
    echo 
"<span style="color: #00f">Yes!</span>";
  } else {
    echo 
"<span style="color: #f00; font-weight: bold">No</span>";
  }
}

?>
<html>
<head>
  <title>Securimage Test Script</title>
</head>

<body>

<h2>Securimage Test Script</h2>
<p>
  This script will test your PHP installation to see if Securimage will run on your server.
</p>

<ul>
  <li>
    <strong>GD Support:</strong>
    <?php print_status( extension_loaded('gd')); ?>
  </li>
  <?php if ( gd_info(); else  = array(); ?>
  <?php if (): ?>
  <li>
    <strong>GD Version:</strong>
    <?php echo ['GD Version']; ?>
  </li>
  <?php endif; ?>
  <li>
    <strong>TTF Support (FreeType):</strong>
    <?php print_status( && ['FreeType Support']); ?>
    <?php if ( && ['FreeType Support'] == false): ?>
    <br />No FreeType support.  Cannot use TTF fonts, but you can use GD fonts
    <?php endif; ?>
  </li> 
  <li>
    <strong>JPEG Support:</strong>
    <?php print_status( && ['JPG Support']); ?>
  </li>
  <li>
    <strong>PNG Support:</strong>
    <?php print_status( && ['PNG Support']); ?>
  </li>
  <li>
    <strong>GIF Read Support:</strong>
    <?php print_status( && ['GIF Read Support']); ?>
  </li>
  <li>
    <strong>GIF Create Support:</strong>
    <?php print_status( && ['GIF Create Support']); ?>
  </li>
 
</ul>

<?php if (): ?>
Since you can see this...<br /><br />
<img src="<?php echo Array['PHP_SELF']; ?>?testimage=1" alt="Test Image" align="bottom" />
<?php else: ?>
Based on the requirements, you do not have what it takes to run Securimage :(
<?php endif; ?>

</body>
</html>