Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed md5 password encryption

added comments for smaples
  • Loading branch information...
commit 7aba9fcac2101cdc5b977f7113b0c4595c0dbd7e 1 parent b07da70
arunoda authored
View
0  php/AppZoneReciever.php 100644 → 100755
File mode changed
View
4 php/AppZoneSender.php 100644 → 100755
@@ -71,7 +71,7 @@ private function sendRequest($postfields){
}
private function getAuthHeader(){
- $auth=$this->username . ':' . md5($this->password);
+ $auth=$this->username . ':' . $this->password;
$auth=base64_encode($auth);
return 'Authorization: Basic ' . $auth;
}
@@ -120,4 +120,4 @@ public function getStatusMessage(){
public function getRawResponse(){
return $this->response;
}
-}
+}
View
0  php/README 100644 → 100755
File mode changed
View
0  php/sample/log.php 100644 → 100755
File mode changed
View
17 php/sample/recieve.php 100644 → 100755
@@ -3,21 +3,36 @@
/**
* Listen to the AppZone MO Message and reply back
*/
+
+//include the api for sending and receiving
include_once '../AppZoneSender.php';
include_once '../AppZoneReciever.php';
include_once 'log.php';
try{
+ //create the receiver
$reciever=new AppZoneReciever();
+ //getting the message content
$rtn="{$reciever->getAddress()} :: {$reciever->getMessage()} :: {$reciever->getCorrelator()}";
logFile($rtn);
- $sender=new AppZoneSender("http://localhost:65182", "PD_ET_e0550", "098f6bcd4621d373cade4e832627b4f6");
+ /*
+ creating the sender object with
+ server url
+ appId
+ password
+ */
+ $sender=new AppZoneSender("http://localhost:8080/appzone-simulator/simulator", "PD_ET_e0550", "098f6bcd4621d373cade4e832627b4f6");
+
+ //sending a one message
$res=$sender->sms("Thanks", $reciever->getAddress());
+
+ //broadcasting a message
$res=$sender->smsToAll("Hi all, we got a new message");
logFile($res);
}
catch(AppZoneException $ex){
+ //throws when failed sending or receiving the sms
logFile("ERROR: {$ex->getStatusCode()} | {$ex->getStatusMessage()}");
}
View
15 php/sample/send.php 100644 → 100755
@@ -4,18 +4,29 @@
* StandAlone SMS Sending
*/
+ //include the api for sending
include_once '../AppZoneSender.php';
+ /*
+ creating the sender object with
+ server url
+ appId
+ password
+ */
$sender=new AppZoneSender(
- "http://localhost:65182",
+ "http://localhost:8080/appzone-simulator/simulator",
"PD_ET_e0550",
"098f6bcd4621d373cade4e832627b4f6");
try{
+ //sending a one message
var_dump( $sender->sms("Message is this", array(78688,'0721683234')));
echo "<br>";
+
+ //broadcasting a message
var_dump( $sender->smsToAll("Message is this"));
}
catch(AppZoneException $ex){
+ //throws when failed sending or receiving the sms
echo "ERROR::{$ex->getStatusMessage()}";
- }
+ }
Please sign in to comment.
Something went wrong with that request. Please try again.