securimage_play.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * Project: Securimage: A PHP class for creating and managing form CAPTCHA images<br />
  4. * File: securimage_play.php<br />
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or any later version.<br /><br />
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.<br /><br />
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA<br /><br />
  19. *
  20. * Any modifications to the library should be indicated clearly in the source code
  21. * to inform users that the changes are not a part of the original software.<br /><br />
  22. *
  23. * If you found this script useful, please take a quick moment to rate it.<br />
  24. * http://www.hotscripts.com/rate/49400.html Thanks.
  25. *
  26. * @link http://www.phpcaptcha.org Securimage PHP CAPTCHA
  27. * @link http://www.phpcaptcha.org/latest.zip Download Latest Version
  28. * @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
  29. * @copyright 2012 Drew Phillips
  30. * @author Drew Phillips <drew@drew-phillips.com>
  31. * @version 3.5.2 (Feb 15, 2014)
  32. * @package Securimage
  33. *
  34. */
  35. require_once dirname(__FILE__) . '/securimage.php';
  36. // if using database, adjust these options as necessary and change $img = new Securimage(); to $img = new Securimage($options);
  37. // see test.mysql.php or test.sqlite.php for examples
  38. $options = array(
  39. 'use_database' => true,
  40. 'database_name' => '',
  41. 'database_user' => '',
  42. 'database_driver' => Securimage::SI_DRIVER_MYSQL
  43. );
  44. $img = new Securimage();
  45. // Other audio settings
  46. //$img->audio_use_sox = true;
  47. //$img->audio_use_noise = true;
  48. //$img->degrade_audio = false;
  49. //$img->sox_binary_path = 'sox';
  50. // To use an alternate language, uncomment the following and download the files from phpcaptcha.org
  51. // $img->audio_path = $img->securimage_path . '/audio/es/';
  52. // If you have more than one captcha on a page, one must use a custom namespace
  53. // $img->namespace = 'form2';
  54. // set namespace if supplied to script via HTTP GET
  55. if (!empty($_GET['namespace'])) $img->setNamespace($_GET['namespace']);
  56. $img->outputAudioFile();