Bad Request als server antwort...

Alles, was PHP betrifft, kann hier besprochen werden.

Bad Request als server antwort...

Postby rabby » 28. December 2003 15:03

hallo welt!
hab ne php funktion zum empfangen von websiten.
hierfür wird eine request via sockets gesendet.
das request sieht so aus:
Code: Select all
$method = "GET";
$request  = "$method /$link HTTP/1.1\r\n";
$request .= "Host: $ar[1]\n";
$request .= 'User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) ';
$request .= "Gecko/20021204\r\n";
$request .= 'Accept: text/xml,application/xml,application/xhtml+xml,';
$request .= 'text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,';
$request .= "image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1\r\n";
$request .= "Accept-Language: en-us, en;q=0.50\r\n";
$request .= "Accept-Encoding: gzip, deflate, compress;q=0.9\r\n";
$request .= "Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66\r\n";
$request .= "Keep-Alive: 300\r\n";
$request .= "Connection: keep-alive\r\n";
$request .= "Referer: $referer\r\n";
$request .= "Cache-Control: max-age=0\r\n";   
$request .= "\r\n";
fputs( $fp, $request );


allerdings antwortet der server:
HTTP/1.1 400 Bad Request
Content-Type: text/html
Date: Sun, 28 Dec 2003 13:49:50 GMT
Connection: close
Content-Length: 20

<h1>Bad Request</h1>


was ist falsch am request?

bei nem andren server hats problemlos funktioniert....


DANKE
rabby
 
Posts: 28
Joined: 15. December 2003 17:39

Return to PHP

Who is online

Users browsing this forum: No registered users and 1 guest