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";




$fp = fsockopen("host", "80", $errno, $errstr, $timeout = 30);
if (!$fp) {
  // ERROR
  echo "$errstr ($errno)";
} else {

//put the data..
  fputs ($fp, $header . $req);
  while (!feof($fp)) {
//read the data returned...
    $res = fgets ($fp, 1024);
        echo $res;
 }
  fclose ($fp);
}

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

Reply via email to