echo "";
echo "";
$mobile = $_SESSION['mobile'];
echo "From : $mobile";
echo "";
echo "";
echo "Sender Mobile number";
echo "";
echo " Mobile number must contain only 10 digits";
echo "";
echo "";
echo "Message your sms balance : {$udata['sms']}";
echo "";
echo " Message boy supports 140 charecters :P";
echo "";
echo "";
echo "You have characters left.";
echo "";
echo "";
echo "";
echo "";
echo "";
Receiving in POST Method:
______________________________________________________________________________________
if(isset($_POST["send"]))
{
$recipient = $_POST["recipient"];
$message = $_POST["message"];
if($recipient == "" || $message == "")
{
echo "are you kidding ? enter something to act";
}
else
{
$recipient = $_POST["recipient"];
$message = $_POST['message'];
$gateway = "http://127.0.0.1:8080/api?action=sendmessage&username=admin&password=admin&recipient=NNNNN&messagetype=SMS:TEXT&messagedata=MMMMM";
$gateway = str_replace("NNNNN", $recipient, $gateway);
$message = str_replace("", "+", $message);
$gateway = str_replace("MMMMM", $message, $gateway);
$r= new HttpRequest($gateway, HttpRequest::METH_POST);
try
{
$r->send();
echo "Message sent to : $recipient";
}
catch (HttpException $ex)
{
echo $ex;
}
}
}
Am not able to send sms using this script, can any one find the error thanks in advance..