ID:               8440
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Closed
 Bug Type:         HTTP related
 Operating System: Debian Linux 2.2.14
 PHP Version:      4.0.4pl1
 New Comment:

you can open a remote file with the fsockopen command

I use this function when I had this problem

/**********************************************************/
function sendToHost($host,$method,$path,$data,$useragent=0)
{
        // Supply a default method of GET if the one passed was empty
        if (empty($method))
                $method = 'GET';
        $method = strtoupper($method);
        $fp = fsockopen($host,80);
        if ($method == 'GET')
                $path .= '?' . $data;
        fputs($fp, "$method $path HTTP/1.1\n");
        fputs($fp, "Host: $host\n");
        fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
        fputs($fp, "Content-length: " . strlen($data) . "\n");
        if ($useragent)
                fputs($fp, "User-Agent: MSIE\n");
        fputs($fp, "Connection: close\n\n");
        if ($method == 'POST')
                fputs($fp, $data);

        while (!feof($fp))
                $buf .= fgets($fp,128);
        fclose($fp);
        return $buf;
}
/**********************************************************/


Previous Comments:
------------------------------------------------------------------------

[2002-03-17 16:13:04] [EMAIL PROTECTED]

Or, just as good, is there an alternate way to open a remote file?

------------------------------------------------------------------------

[2002-03-17 16:07:56] [EMAIL PROTECTED]

Uggh...is there any way to fix it without waiting a month?

------------------------------------------------------------------------

[2002-03-17 15:34:47] [EMAIL PROTECTED]

In about a month.

Derick

------------------------------------------------------------------------

[2002-03-17 15:24:59] [EMAIL PROTECTED]

When will the 4.2.x branch be out though?

------------------------------------------------------------------------

[2002-03-16 18:02:03] [EMAIL PROTECTED]

You can try a snapshot from snaps.php.net, I beilieve it's fixed in the
PHP 4.2.x branch.

Derick

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/8440

-- 
Edit this bug report at http://bugs.php.net/?id=8440&edit=1

Reply via email to