Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <?php
  2.  
  3. //1st Method
  4.  
  5. $msg="Cron has been run and SMS sent to the respective Marketing Managers Java script.";
  6. $my=Mobile no;
  7. $url="http://websiteapi/SendSMS/sendmsg.php?uname=XXXXX&pass=YYYYY&send=ZZZZZ%20&dest=".$my."&msg=".$msg."";
  8. $url = str_replace(" ", '%20', $url);
  9.  
  10. $ch = curl_init();
  11.  
  12. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  13.  
  14. curl_setopt($ch, CURLOPT_URL, $url);
  15.  
  16. $ret = curl_exec($ch);
  17.  
  18.  
  19. //2nd Method
  20.  
  21. $msg="Cron has been run.";
  22. $my=Mobile no;
  23. $url="http://websiteapi/SendSMS/sendmsg.php?uname=XXXXX&pass=YYYYY&send=ZZZZZ%20&dest=".$my."&msg=".$msg."";
  24. $url = str_replace(" ", '%20', $url);
  25. $resultaat = SendSMS($my, $msg);
  26.  
  27. function SendSMS($my, $msg)
  28. {
  29. $user = "XXXXX";
  30. $pass = "YYYYY";
  31. //$from = "*******";
  32.  
  33. $txt = substr($msg, 0, 160);
  34. $url = "http://website-name/SendSMS/sendmsg.php?";
  35. $url .= "uname=".$user."&pass=".$pass;
  36. $url .= "&send=ZZZZZ&dest=".$my."&text=".str_replace(" ", "%20", $msg);
  37.  
  38. $ch = curl_init($url);
  39. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  40. $result = curl_exec($ch);
  41. curl_close($ch);
  42. $results = explode("n", $result);
  43. print_r($result);
  44. echo $results[0];
  45. return $results[0];
  46. }
  47.  
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement