[PHP] get method http 1.1 eror

2003-11-11 Thread QT
Dear Sirs,

I am using following method for GET but I am getting this error from server;

HTTP/1.1 505 HTTP Version Not Supported Content-Type: text/plain Date: Tue,
11 Nov 2003 10:08:44 GMT Server: Apache Coyote/1.0 Connection: close

?php
$fp = fsockopen (www.example.com, 80, $errno, $errstr, 30);
if (!$fp) {
echo $errstr ($errno)br\n;
} else {
fputs ($fp, GET / HTTP/1.0\r\nHost: www.example.com\r\n\r\n);
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
?What should I do? I can't find any solutionBest Regards

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



Re: [PHP] get method http 1.1 eror

2003-11-11 Thread Marek Kilimajer
QT wrote:
Dear Sirs,

I am using following method for GET but I am getting this error from server;

HTTP/1.1 505 HTTP Version Not Supported Content-Type: text/plain Date: Tue,
11 Nov 2003 10:08:44 GMT Server: Apache Coyote/1.0 Connection: close
Weird. Use HTTP/1.1 then. And add Connection: close header.

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


Re: [PHP] get method http 1.1 eror

2003-11-11 Thread Chris Shiflett
--- QT [EMAIL PROTECTED] wrote:
 I am using following method for GET but I am getting this error from
 server;
 
 HTTP/1.1 505 HTTP Version Not Supported

This means that the version of HTTP that you are using is not supported by
the server you are sending your request to.

 fputs ($fp, GET / HTTP/1.0\r\nHost: www.example.com\r\n\r\n);

Since you are sending the Host header, this is a valid HTTP/1.1 request,
so you can just go ahead and change your HTTP/1.0 to HTTP/1.1.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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