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

Your name:

Reply:


Posted by cc on 10/12/05 18:23

Tommy, r u serious?
this ain't what you called 'thread or process',
just something like an user agent, like any web browser.

On 10/12/05, Tommy Jensehaugen <tommy_jensehaugen@hotmail.com> wrote:
> 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
>
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация