omides_86 Posted April 27, 2011 Share Posted April 27, 2011 can anyone help me with this coding <?php ######################################################## # Login information for the SMS Gateway ######################################################## $ozeki_url = "http://203.217.178.124:8080/15888v3/smsgateway/send_sms.php"; ######################################################## # 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 200 OK\r\n"; $out .= "Host: $args[1]:$args[2]\r\n"; $out .= "deliver : 0\r\n"; $out .= "StatusCode : 200\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, $keyword, $smsid, $shortcode, $debug=false){ global $ozeki_url; $url = '&keyword='.urlencode($keyword); $url.= '&smsid='.urlencode($smsid); $url.= '&shortcode='.urlencode($shortcode); $url.= '&sender='.urlencode($phone); $url.= '&details='.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("<",">"),$response). "</pre><br>"; } return($response); } ######################################################## # GET data from send_sms.php ######################################################## $phonenum = $_POST['sender']; $message = $_POST['details']; $keyword = $_POST['keyword']; $shortcode = $_POST['shortcode']; $smsid = $_POST['smsid']; $debug = true; ozekiSend($phonenum,$message,$keyword,$smsid,$shortcode,$debug); ?> when i run this coding this is the result that i have Request: http://203.217.178.124:8080/15888v3/smsgateway/send_sms.php&keyword=MOF&smsid=209&shortcode=15888&sender=0192263901&details=try++test Response: Connection timed out (110) Link to comment https://forums.phpfreaks.com/topic/234815-php-and-sms/ Share on other sites More sharing options...
Pikachu2000 Posted April 27, 2011 Share Posted April 27, 2011 "Connection timed out" Not much else to say about it really. I cant even get a ping reply from that IP address. Link to comment https://forums.phpfreaks.com/topic/234815-php-and-sms/#findComment-1206724 Share on other sites More sharing options...
omides_86 Posted April 27, 2011 Author Share Posted April 27, 2011 what do you mean Pikachu2000? is it because of my ip address? im really confuse here Link to comment https://forums.phpfreaks.com/topic/234815-php-and-sms/#findComment-1206730 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.