Actually I got the idea he was opening a file through http as in

$fp = fsockopen ("192.168.1.1", 8080, $errno, $errstr, 5);

And whatever he was trying to get at was not being allowed to be retrieved.
But I may be wrong.

Perhaps the server is behind a firewall and needs to get through the proxy.
If this is the case look at CURL.. Just point it to the proxy server,

I also use fsockopen as above to go through a proxy server.
But CURL does it better.

I basically had a similar problem which I handle as such...


        if ($proxy) {
                $fp = fsockopen ("192.168.1.1", 8080, $errno, $errstr, 5);
        } else {
                $fp = fsockopen ("adds.aviationweather.noaa.gov", 80, $errno, $errstr, 
5);
                if (!($fp)) {
                        echo ("$errstr");
                }
        }

        if ($fp) {

                $header = "GET 
http://adds.aviationweather.noaa.gov/projects/adds/metars/index.php?metarIds=$iac 
HTTP/1.1\r\n";
                $header .= "Accept: */*\r\n";
                $header .= "Accept-Language: en-ca\r\n";
                $header .= "Accept-Encoding: gzip, deflate\r\n";
                $header .= "User-Agent: Mozilla/4.0 (compatible)\r\n";
                $header .= "Host: www.wimac.org\r\n";
                $header .= "Connection: Keep-Alive\r\n";
                if ($proxy) {
                        $header .= "Proxy-Authorization: Basic ";
                        $header .= base64_encode("username:password");
                }
                $header .= "\r\n";
                $header .= "\r\n";

                fputs ($fp, "$header");

                if (socket_set_timeout($fp, 5, 0)) {

                        $fpmetar = fopen ($fname, "w+");
                        if (!$fpmetar) {
                                echo "Unable to open new METAR file $fname - Using old 
METAR file\n";
                        } else {
                                while (!feof($fp)) {
                                        fputs ($fpmetar, fgets ($fp,128));
                        }
                                fclose($fpmetar);
                        }
                }

                // close the file
        fclose ($fp);
        }





Mike



*********** REPLY SEPARATOR  ***********

On 28/12/2002 at 11:27 PM Sean Burlington wrote:

>Hatem Ben wrote:
>> From: "Sean Burlington" <[EMAIL PROTECTED]>
>>>
>>>it's exactly what it says it is...
>>>
>>>the website is experiencing technical difficulties...
>>>
>>
>>
>> Yep, this make a confusion for me, and a stupid error that could be
>solved
>> in one minute, was done in one day.
>>
>>
>[SNIP]
>>
>>
>> In conclusion our ISP is blocking such websites (an internet censorship
>> system) and returned that message.
>> I have said dns error, coz for dns error we got same message (maybe the
>> server is assumed in all cases down), the original dns error is always
>> blocked and we got that message inspite.
>>
>
>It's not censorship
>
>they are economising by using a proxy server
>
>and using one that gives unhelpful error messages
>
>BTW - they in this case are the people providing you with your
>connection (not the web hosting company)
>
>they are not blocking the site
>
>but when the page returns no data - they return an error message - this
>is resonable - it just isn't very helpful for web developers.
>
>
>I'd suggest that you see if you can get a direct connection for testing
>purposes - either by changing browser settings or getting another isp.
>
>Proxys are great for saving bandwidth - but terrible for developing
>websites through :)
>
>--
>
>Sean
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php





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

Reply via email to