//The complete free software package may be dowloaded from http://tyaga.org/kit/.
<?php
//header('Content-type: text/plain');

if (isset($_POST['prowl'])) {
  
$_GET['prowl'] = $_POST['prowl'];
}

if (isset(
$_GET['prowl'])) {
  
$query explode(" ",$_GET['prowl']);
  
  include(
"common_functions.php");
  
  if (
$query[0]=="audit" OR $query[0]=="eval") {   
    if (
strpos($query[1],"://")!==false) {
      
$url $query[1];        
    }
    else if (
strpos($query[1],".")!==false) { //CHANGE SLASH TO DOT!!!!
      
$query_icb $query[1];      
      
$query_units $query[2];
      
$query_keywd $query[3];
      if (
$query_keywd=="report") {
          
$for_word $query[4];
          
$query_year $query[5];                
      }
                  
      list(
$search_q,$reporter) = get_reporter($query_icb,$query_units); //echo "search_q, reporter: ". $search_q . $reporter;
            
      
if ($reporter) {
          if (
$reporter=="localhost") { //CHANGE tyaga.org to your reporter application domain!!!!
            
$url $prepath ."reports/"str_replace(array("/","."),"",$query_icb) ."_"$query_year ."_"$query_units .".txt"//echo "url: ". $url;
          
}
        else {
          
$url "http://"$reporter ."/?prowl=get+"$query_icb ."+"$query_units ."+report+for+"$query_year;
        }
      }
    } 
//echo "for ". $query[0] .": ". $url;    
    
    
if ($query[0]=="audit") {
      include(
"AUDIT.php");
    }
    else {
      include(
"EVAL.php");
    }    
  }
  else if (
$query[0]=="get") {
    if (
strpos($query[1],"://")!==false) {
      
$url $query[1];        
    }
    else if (
strpos($query[1],"/")!==false) { //CHANGE SLASH TO DOT!!!!
      
$query_icb str_replace(array("/","."),"",$query[1]);      
      
$query_units $query[2];
      
$query_keywd $query[3];
      if (
$query_keywd=="report") {
          
$for_word $query[4];
          
$query_year $query[5];      
          
$url $prepath ."reports/"$query_icb ."_"$query_year ."_"$query_units .".txt";//echo "url: ". $url;
      
}
    }
    
    include(
"GET.php");    
  }
  else { 
//default is see-query    //echo "<br />for posting or witnessing: ". $_GET['prowl'] ."<br />";
    
if ($return_by=="mail") { //print_r($_GET);
      
sleep(10); //echo "accomodates possible delays in mail-to-publish/blog apps";
      
include("SEE.php");
      if (
strpos($message," has not published the record yet.")!==false) { //echo " attempt another try ";
          
sleep(15);
          include(
"SEE.php"); //echo $message;
      
}      
    }     
    else {
      include(
"SEE.php");
      echo 
$message;
    }
  }  
}
?>
1