Services_ProjectHoneyPot
[ class tree: Services_ProjectHoneyPot ] [ index: Services_ProjectHoneyPot ] [ all elements ]

Source for file example.php

Documentation is available at example.php

  1. <?php
  2. //error_reporting(E_ALL|E_STRICT);
  3.  
  4. set_include_path(get_include_path(. PATH_SEPARATOR . dirname(__FILE__'/../');
  5.  
  6. require_once 'Services/ProjectHoneyPot.php';
  7.  
  8. /**
  9.  * config.php, includes:
  10.  * <?php $access_key = '...'; ?>
  11.  * 
  12.  * ... is the access key
  13.  */
  14. include dirname(__FILE__'/config.php';
  15.  
  16. try {
  17.     $sphp = new Services_ProjectHoneyPot($access_key);
  18.  
  19.     //$ip = $_SERVER['REMOTE_ADDR'];
  20.     //$ip = '24.132.194.14';
  21.     //$ip = '62.75.159.212';
  22.     //$ip = 'heise.de';
  23.  
  24.     $status $sphp->query($harvester);
  25.  
  26. }
  27.     echo '<br />MSG: ' .$e->getMessage();
  28.     echo '<br />CODE: ' $e->getCode();
  29.     exit;
  30. }
  31.  
  32. if (count($status== 0{
  33.     die("No results.");
  34. }
  35.  
  36. echo "Status-Count: " count($status"<br />\n";
  37.  
  38. foreach ($status as $res{
  39.  
  40.     $ip  key($res);
  41.     $res $res[$ip];
  42.  
  43.     if ($res === false{
  44.         echo 'Don\'t bother. Probably a regular user. ;-)' "\n";
  45.     else {
  46.         echo '<pre>'var_dump($res); echo '</pre>';
  47.     }
  48. }
  49. ?>

Documentation generated on Mon, 11 Mar 2019 15:45:14 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.