Advertisement
Guest User

ONG

a guest
Feb 4th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <?php
  2.  
  3. /******************************************************
  4.  
  5. SMS Notification Sample Script for Webhook
  6. Using your SMS API Provider
  7. Created by Elton - JotForm Tech Support
  8.  
  9. ******************************************************/
  10.  
  11. //Strip off slashes
  12. function stripslashes_deep($value){
  13. $value = is_array($value) ?
  14. array_map('stripslashes_deep', $value) :
  15. stripslashes($value);
  16. return $value;
  17. }
  18.  
  19. //Catch form field values
  20. $result = stripslashes_deep($_REQUEST['rawRequest']);
  21. $obj = json_decode($result, true);
  22.  
  23. //Replace your authentication key & credentials
  24. $username= "YourAuthKey";
  25. $password= "102234";
  26.  
  27.  
  28. //Replace your form field names
  29. $mobileNumber = $obj['q1_mobileNo']; //mobile no. from form data
  30. $message = urlencode($obj['q2_message']); //message from form data
  31.  
  32. //Prepare you post parameters
  33. $postData = array(
  34. 'username' => "Transportify",
  35. 'password' => "a08c3b09eab2834b95d3943b3afe01c5",
  36. 'mobiles' => "09274037226",
  37. 'fullmesg' => "TESTPHP",
  38. 'originator' => "DEVSMX",
  39.  
  40. );
  41.  
  42. //Replace your API endpoint
  43. $url="https://svr30.synermaxx.asia/vmobile/demoV2/api/sendnow.php";
  44.  
  45. // init the resource
  46. $ch = curl_init();
  47. curl_setopt_array($ch, array(
  48. CURLOPT_URL => $url,
  49. CURLOPT_RETURNTRANSFER => true,
  50. CURLOPT_POST => true,
  51. CURLOPT_POSTFIELDS => $postData
  52. //,CURLOPT_FOLLOWLOCATION => true
  53. ));
  54.  
  55. //Ignore SSL certificate verification
  56. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  57. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  58.  
  59. //get response
  60. $output = curl_exec($ch);
  61.  
  62. //Print error if any
  63. if(curl_errno($ch))
  64. {
  65. echo 'error:' . curl_error($ch);
  66. }
  67.  
  68. curl_close($ch);
  69. echo $output;
  70. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement