Re: Run a php script as a separate thread/process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you very much. This is what I ended up with if anyone needs it:

<?php
function runSeparateThread($strHost, $strPath="/") {
 $fFile = fsockopen($strHost, 80, $intError, $strError);
 if ($fFile) {
  $out = "GET ".$strPath." HTTP/1.1\r\n";
  $out .= "Host: ".$strHost."\r\n";
  $out .= "Connection: Close\r\n\r\n";
  if(!fwrite($fFile, $out)){
   $result = "runSeparateThread():fwrite(). Could not write:'".$out."'. 
Host:'".$strHost."'. Path:'".$strPath."'";
  } else {
   $result = true;
  }
  fclose($fFile);
 } else {
  $result = "runSeparateThread():fsockopen(): Could not connect to 
".$strHost." (".$intError.") ".$strError.".";
 }
 return $result;
}
?> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux