Hi,

$str = "DATA=abc&DATA=123&DATA=xxx"
I believe you should encode the string with http://www.php.net/rawurlencode
but make sure u don't encode the & and = signs.

$len = strlen($str);

    $p = "POST /httpsmspp/servlet/sms HTTP/1.0\r\n";
  $p.= "Host: 123.31.228.206\r\n";
  $p.= "Content-type: application/x-www-form-urlencoded\r\n";
I think you the Content-Type here is wrong, since you don't encode your
string to match the content type. Perhaps text/plain might do it.
$p.= "Content-length: $len\n\n";
here there should be another line
    $p .= "\r\n";
here the \n\n should be \r\n
$p.= "$str\n";
here \n should be \r\n
$p.= "\r\n";
the above line should not exist
$server = "123.31.228.206";
$connection_timeout = 10;
$fp = fsockopen ($server, 80, &$errno, &$errstr, $connection_timeout);

  fputs ($fp,$p);
        $recdata = "";
        while (!feof($fp))
         {
          $recdata .= fgets ($fp,128);
         }
  fclose ($fp);

What is the response from the server ?

Hope this helps,
Catalin

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



Reply via email to