[eluser]SamoualSys[/eluser]
i have sms api its not working its give me nothing can any one help me in that
this the code for the sms api
Code:
class Sms_api {
//change this to the actual user and password
private $username = 'myusername';
private $password = 'password';
private $sendname = 'sendername';
private $url = 'http://www.mydomain.net/api/sendSMS.php';
private $encode ='utf-8';
public function send_sms( $phone, $text ){
$url = $this->url . '?userid=' . $this->username .
'&password;=' . $this->password .
'&to;=' . $phone .
'&text;=' . urlencode( $text ).
'&sender;=' . $this->sendname .
'&encoding;=' . $this->encode ;
$r = @file( $url );
$res = substr( $r[0], 9, 0);
if( $res == '0' ){
return true;
}
return flase;
}
if its success you get this in the page
Code:
Error : 0
MessageID : 5
iam sending using this controller for testing
Code:
$this->load->library('sms_api');
$data['phone'] = '123222222';
$data['text'] = 'you have got sms in your inbox';
$this->sms_api->send_sms( $data['phone'], $data['text'] );
$this->render();
please help me in that