This forum is in archive mode. You will not be able to post new content.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AlexCarter87

Pages: [1]
1
Hacking and Security / Re: can a php script used for sending sms ?
« on: January 09, 2013, 08:42:42 AM »
Yes there is a chance for that. Get an SMS gaeway, like i did it with Ozeki NG SMS Gateway.
I show you a code how you can send sms using php script.

Code: [Select]
<?php ######################################################## # Login information for the SMS Gateway ######################################################## $ozeki_user = "admin"; $ozeki_password = "abc123"; $ozeki_url = "http://127.0.0.1:9501/api?"; ######################################################## # Functions used to send the SMS message ######################################################## function httpRequest($url){ $pattern = "/http...([0-9a-zA-Z-.]*).([0-9]*).(.*)/"; preg_match($pattern,$url,$args); $in = ""; $fp = fsockopen("$args[1]", $args[2], $errno, $errstr, 30); if (!$fp) { return("$errstr ($errno)"); } else { $out = "GET /$args[3] HTTP/1.1\r\n"; $out .= "Host: $args[1]:$args[2]\r\n"; $out .= "User-agent: Ozeki PHP client\r\n"; $out .= "Accept: */*\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $in.=fgets($fp, 128); } } fclose($fp); return($in); } function ozekiSend($phone, $msg, $debug=false){ global $ozeki_user,$ozeki_password,$ozeki_url; $url = 'username='.$ozeki_user; $url.= '&password='.$ozeki_password; $url.= '&action=sendmessage'; $url.= '&messagetype=SMS:TEXT'; $url.= '&recipient='.urlencode($phone); $url.= '&messagedata='.urlencode($msg); $urltouse =  $ozeki_url.$url; if ($debug) { echo "Request: <br>$urltouse<br><br>"; } //Open the URL to send the message $response = httpRequest($urltouse); if ($debug) { echo "Response: <br><pre>". str_replace(array("<",">"),array("&lt;","&gt;"),$response). "</pre><br>"; } return($response); } ######################################################## # GET data from sendsms.html ######################################################## $phonenum = $_POST['recipient']; $message = $_POST['message']; $debug = true; ozekiSend($phonenum,$message,$debug); ?>


Hope it helps some of you.

Pages: [1]


Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.