The problem with this code is either the sending SMS has been sent successfully or NOT successfully will echo for me the same message.
I am sure the problem in IF ELSE but I could not solve it.Code:<?php $baseurl = "XXXX"; $username = urlencode("XXXX"); $password = urlencode("XXXX"); $mobile = urlencode("6".$_POST['mobile']); $message = urlencode($_POST['message']); $sender = urlencode($_POST['sender']); $type = urlencode("1"); $url = $baseurl."/websmsapi/ISendSMS.aspx?username=".$username."&password=".$password. "&mobile=".$mobile."&message=".$message. "&sender=".$sender."&type=".$type; // do sendmsg call $ret = fetchURL($url); $send = split(":",$ret); if ($send[0] == "ID") { // Message was submitted to gateway successfully echo ($ret); echo "Your Message has been sent successfully man!"; } else { // There was an ERROR echo ($ret); echo "OMG. You made an Error man!. Go back and check your staff!!"; } ?>
Any help please?


Reply With Quote

Bookmarks