-
Notifications
You must be signed in to change notification settings - Fork 0
/
SenderMalli.php
41 lines (31 loc) · 931 Bytes
/
SenderMalli.php
1
<?phpinclude_once 'AppZoneSender.php';include_once 'AppZoneReciever.php';function logFile($rtn){ $f=fopen("log.txt","a"); fwrite($f, $rtn . "\n"); fclose($f);}$time=$_SERVER['REQUEST_TIME'];$date = date('m/d/Y h:i:s a', $time);$rtn="\n*** App Started via HTML UI on ".$date;logFile($rtn);$tp = $_POST["tp"];$ans = $_POST["ans"];$con = mysql_connect("localhost","root","sa"); if(!$con){ die("MySQL Connection Failed! " . mysql_error()); } $db = mysql_select_db('chootimalli',$con); if(!$db){ die("Database Connection Failed! " . mysql_error()); } mysql_query("INSERT INTO sentBox (tp,ans) VALUES('".$tp."','".$ans."')");try{ $sender=new AppZoneSender("http://sdp-simulator.appspot.com/", "SMS_1320", "pass"); $res=$sender->sms($tp, $ans); logFile("***Message Sent by Admin, ".$res); }catch(AppZoneException $ex){ logFile("ERROR: {$ex->getStatusCode()} | {$ex->getStatusMessage()}");}?>