Hallo Mobhar
thanks for the response. Ich just find the following file which is similar and should be send sms if you enter the destination phone nr and message test as follow:
sms.php +41798006767 "This is test SMS".
The code is from phpclass...
Could you pleaese have a look, how to integrate this into phpmaker?
thanks anyway for your time.
mpol_ch
#!/usr/bin/php
<?php
/*
BETAMAX SMS CLASS
...
Your commandline would look like sms.php <destination> <text>
f.i.
sms.php +00000000000 "text encapsulated by hyphens and all should work fine".
REMOVE FOR EXAMPLE CODE TO WORK
//create new instance
$sms=new betamaxsms();
//setusername
$sms->username="<your username>";
//setpassword
$sms->userpassword="<your password>";
//setnumber
$sms->userphone="<your registered number>";
//These come from our commandline
$sms->destination=$argv[1];
$sms->text=$argv[2];
//mni phonebook example - this shows how you can easily
//translate names on the commandline to numbers
if($sms->destination == "John"){
$sms->destination="0000000000";
}elseif($sms->destination == "Jane"){
$sms->destination="000000001";
};
$sms->sendsms();
exit;
//REMOVE FOR EXAMPLE CODE TO WORK
class betamaxsms{
public $provurl="myaccount.VoipCheap.com";
public $okresult="/<resultstring>success/";
public $username;
public $userphone;
public $userpassword;
public $destination;
public $text;
public $result;
function sendsms(){
$text=urlencode($this->text);
$build="hxxs://".$this->provurl."/clx/sendsms.php?username=".$this->username."&password=".$this->userpassword."&from=".$this->userphone."&to=".$this->destination."&text=".$text;
$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 met text:\n\n";
echo urldecode($this->text);
echo "\n\nverzonden aan:\n\n";
echo $this->destination;
echo "\n\n";
}
function resultfail(){
echo "SMS MISLUKT !!!\n\n";
echo "technische data:\n";
echo $this->result;
}
}
?>
In the documentation is says that you can call the script like
sms.php destination "text"
Can I just enter this code in row_inserting? Or do I need shell_exec()...
my server has cURL enabled...
mpol_ch