Welcome Guest, Not a member yet? Register   Sign In
Sending message to a mobile number via fsockopen


This is my problem. I want to send a sms message via a host on another domain. I'm supposed to call a page and send variables, then get a response on the status of message I sent. The error message i get says: "Bad Request".

This is my code:

$sms_host = 'sms.abc.com';       //sms processing gateway
$str = "/abc/abc.asp?";      //path to script  
$str .= "username=abc&";             //the required parameters >> downwards
$str .= "password=abc&";
$str .= "message=testing&";          
$str .= "mobile=3667348829&";
$str .= "sender=CallBackNow&";
$str .= "type=0";

$request = "GET " . $str . " HTTP/1.1\r\n";  
$request .= 'Host: '.$sms_host.' \r\n';
$reply = "";  

$fp = fsockopen($sms_host, 80, $errno, $errstr, 30);
if (!$fp)
    echo "$errstr ($errno)<br />\n";
    fwrite($fp, $request);
    while (!feof($fp)) {
        $reply =  fgets($fp, 128);

Any suggestions, Please?


Theme © iAndrew 2016 - Forum software by © MyBB