Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //1st Method
- $msg="Cron has been run and SMS sent to the respective Marketing Managers Java script.";
- $my=Mobile no;
- $url="http://websiteapi/SendSMS/sendmsg.php?uname=XXXXX&pass=YYYYY&send=ZZZZZ%20&dest=".$my."&msg=".$msg."";
- $url = str_replace(" ", '%20', $url);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_URL, $url);
- $ret = curl_exec($ch);
- //2nd Method
- $msg="Cron has been run.";
- $my=Mobile no;
- $url="http://websiteapi/SendSMS/sendmsg.php?uname=XXXXX&pass=YYYYY&send=ZZZZZ%20&dest=".$my."&msg=".$msg."";
- $url = str_replace(" ", '%20', $url);
- $resultaat = SendSMS($my, $msg);
- function SendSMS($my, $msg)
- {
- $user = "XXXXX";
- $pass = "YYYYY";
- //$from = "*******";
- $txt = substr($msg, 0, 160);
- $url = "http://website-name/SendSMS/sendmsg.php?";
- $url .= "uname=".$user."&pass=".$pass;
- $url .= "&send=ZZZZZ&dest=".$my."&text=".str_replace(" ", "%20", $msg);
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $result = curl_exec($ch);
- curl_close($ch);
- $results = explode("n", $result);
- print_r($result);
- echo $results[0];
- return $results[0];
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement