[eluser]tobben[/eluser]
Here is an example of a function that im using for talking to a SMS gateway api..
It's not CI-ified, but it would probably give you a taste.
The SMS gateway provider will probably also give you some technical info on how to connect and manage their API or whatever.
Code:
<?php
function SendSms($sender, $recipients, $message, $priceGroup, $flash)
{
$CID = "xxx";
$password = "xxxxx";
if (!is_numeric($priceGroup) || !is_numeric($flash))
return "priceGroup and flash must be a number";
$serverRequest = "http://the.smsprovider.com/api.ext";
$serverRequest .= "?CID=".$CID;
$serverRequest .= "&Password;=".$password;
if (is_numeric($sender))
$serverRequest .= "&fromNumber;=".$sender;
else
$serverRequest .= "&fromAlpha;=".$sender;
$serverRequest .= "&recipient;=".$recipients;
$serverRequest .= "&Msg;=".urlencode($message);
$serverRequest .= "&priceGroup;=".$priceGroup;
$serverRequest .= "&flash;=".$flash;
$serverResult = file_get_contents($serverRequest);
if (!$serverResult)
return "Returned error while trying to connect to gateway";
$xml = simplexml_load_string($serverResult);
if ($xml->success == "true")
$result = $xml->msgid;
else
$result = $xml->errormsg;
return $result;
}
?>