* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
> Hi there the following code doesnt seem to work, i am getting a bad request
> sent back from the server, what could be the problem of something so
> simple ?
> 
> $header .= "POST test.php HTTP/1.0\r\n";
> $header.= "Host: host\r\n";
> $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
> $header .= 'Content-Length: ' . strlen($req) . "\n\n";
> $header .= "Connection: close\n\n";
> $header.= "$req\n";
> $header.= "\r\n";

The last two lines should be:

  $header.= "\r\n";
  $header.= "$req"; #Note, no \n

Make sure all your headers have \r\n endings.  Technically the $req
is not part of the headers but the actual content to be sent.


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
          http://zirzow.dyndns.org/html/mlists/

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

Reply via email to