Does anyone know of a free SMS gateway in the uk where sms messages can be sent from a form on a webpage.
| Code: |
|
<?php //set up variables $info = "1"; $test = "0"; $address = "www.txtlocal.com/sendsmspost.php"; $message = "Hello this is a test with an ampersand (&) and a £5 note"; $message = urlencode($message); //encode special characters (e.g. £,& etc) $from = "Jims Autos"; $uname = "youremailaddress"; $pword = "yourpassword"; $selectednums = "447740101098"; //build url $data = "uname=" . $uname . "&pword=" . $pword . "&message=" . $message . "&from=" . $from . "&selectednums=" . $selectednums . "&info=" . $info . "&test=" . $test; //send messages $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"http://$address"); //curl_setopt($ch, CURLOPT_URL,"https://$address"); //secure connection curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); //curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //use this to suppress output $result = curl_exec ($ch); //This is the result from Txtlocal - store as required curl_close ($ch); ?> |
