Hello
I realized to send SMSs with PHPMAKER 10.0.5 with easyvoip.com. This is a provider of betamax. You can create an account by one of them and send the SMS. Please keep in mind that you must have fully working web server installation. The solution is working on my side at ubuntu linux installation and not on xampp/win8. The below solutions will send a SMS on Row Inserted Event. You must adjust the username and password...
The source based on code from: hxxx://www.phpclasses.org/package/4501-PHP-Sen ... eways.html
Step 1:
Server Evets->Global->All Pages->Global Code
class betamaxsms{
public $provurl="www.easyvoip.com";
public $okresult="/<resultstring>success/";
public $username;
public $userphone;
public $userpassword;
public $destination;
public $text;
public $result;
function sendsms(){
$text=urlencode($this->text);
$build="hxxxs://".$this->provurl."/myaccount/sendsms.php?username=".$this->username."&password=".$this->userpassword."&from=".$this->userphone."&to=".$this->destination."&text=".$text;
//$build="hxxs://www.easyvoip.com/myaccount/sendsms.php? ... &text=This is content of my SMS";
$result=$this->engine($build);
if($result == 1){
$this->resultok();
}else{
$this->resultfail();
}
}
function engine($build){
$ch = curl_init($build);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0);
$this->result = curl_exec($ch);
curl_close($ch);
return(preg_match ( $this->okresult , $this->result));
}
function resultok(){
echo "SMS mit dem Inhalt:\n\n";
echo urldecode($this->text);
echo "\n\n wurde verschickt an:\n\n";
echo $this->destination;
echo "\n\n";
echo "<br><a href='adressenlist.php'>Zurück</a>";
}
function resultfail(){
echo "Leider hat es nicht geklappt !!!\n\n";
echo "Fehlermeldung:\n";
echo $this->result;
echo "<br><a href='adressenlist.php'>Zurück</a>";
}
}
Step 2:
Server Events->Table-Specific->Common->Row_Inserted
// Row Inserted event
function Row_Inserted($rsold, &$rsnew) {
$sms=new betamaxsms();
$sms->username='USERNAME';
$sms->userpassword='PASSWORD';
$sms->userphone='+4178xxxxxxx';
$sms->destination=$rsnew["Ziel"];
$sms->text=$rsnew["Text"];
$sms->sendsms();
exit;
}
I hope it will help you.
mpol_ch