Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /******************************************************
- SMS Notification Sample Script for Webhook
- Using your SMS API Provider
- Created by Elton - JotForm Tech Support
- ******************************************************/
- //Strip off slashes
- function stripslashes_deep($value){
- $value = is_array($value) ?
- array_map('stripslashes_deep', $value) :
- stripslashes($value);
- return $value;
- }
- //Catch form field values
- $result = stripslashes_deep($_REQUEST['rawRequest']);
- $obj = json_decode($result, true);
- //Replace your authentication key & credentials
- $username= "YourAuthKey";
- $password= "102234";
- //Replace your form field names
- $mobileNumber = $obj['q1_mobileNo']; //mobile no. from form data
- $message = urlencode($obj['q2_message']); //message from form data
- //Prepare you post parameters
- $postData = array(
- 'username' => "Transportify",
- 'password' => "a08c3b09eab2834b95d3943b3afe01c5",
- 'mobiles' => "09274037226",
- 'fullmesg' => "TESTPHP",
- 'originator' => "DEVSMX",
- );
- //Replace your API endpoint
- $url="https://svr30.synermaxx.asia/vmobile/demoV2/api/sendnow.php";
- // init the resource
- $ch = curl_init();
- curl_setopt_array($ch, array(
- CURLOPT_URL => $url,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_POST => true,
- CURLOPT_POSTFIELDS => $postData
- //,CURLOPT_FOLLOWLOCATION => true
- ));
- //Ignore SSL certificate verification
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- //get response
- $output = curl_exec($ch);
- //Print error if any
- if(curl_errno($ch))
- {
- echo 'error:' . curl_error($ch);
- }
- curl_close($ch);
- echo $output;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement