Guest User

Untitled

a guest
Mar 22nd, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2.  
  3. $num = "92xxxxxxxxxx";
  4. $mes = "Hello World (&) and a 5 note";
  5.  
  6. // Configuration variables
  7. $type = "xml";
  8. $id = "myid";
  9. $pass = "mypass";
  10. $lang = "English";
  11. $mask = "mymask";
  12.  
  13. // Data for text message
  14. $to = $num ;
  15. $message = $mes;
  16. $message = urlencode($message);
  17.  
  18. // Prepare data for POST request
  19. $data = "id=".$id."&pass=".$pass."&msg=".$message."&to=".$to."&lang=".$lang."&mask=".$mask."&type=".$type;
  20.  
  21. // Send the POST request with cURL
  22. $ch = curl_init('http://www.sms4connect.com/api/sendsms.php/sendsms/url');
  23. curl_setopt($ch, CURLOPT_POST, true);
  24. curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  25. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  26. $result = curl_exec($ch); //This is the result from SMS4CONNECT curl_close($ch);
  27. echo $result;
  28. $query = mysql_query("INSERT INTO sms_response (phone, msg) values('$to','$result')");
  29.  
  30. ?>
Add Comment
Please, Sign In to add comment