Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $num = "92xxxxxxxxxx";
- $mes = "Hello World (&) and a 5 note";
- // Configuration variables
- $type = "xml";
- $id = "myid";
- $pass = "mypass";
- $lang = "English";
- $mask = "mymask";
- // Data for text message
- $to = $num ;
- $message = $mes;
- $message = urlencode($message);
- // Prepare data for POST request
- $data = "id=".$id."&pass=".$pass."&msg=".$message."&to=".$to."&lang=".$lang."&mask=".$mask."&type=".$type;
- // Send the POST request with cURL
- $ch = curl_init('http://www.sms4connect.com/api/sendsms.php/sendsms/url');
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $result = curl_exec($ch); //This is the result from SMS4CONNECT curl_close($ch);
- echo $result;
- $query = mysql_query("INSERT INTO sms_response (phone, msg) values('$to','$result')");
- ?>
Add Comment
Please, Sign In to add comment