ó¸®ÁßÀÔ´Ï´Ù.
Àü¼Û¿¹Á¦
À¥»çÀÌÆ® ¿¬µ¿¾È³»
1. ÀÎÁõÅ° ¹× Çã¿ëIP
2. ¹®ÀÚÀÎÅÍÆäÀ̽º
3. Àü¼Û¿¹Á¦
4. °á°úÄÚµå
5. ¹®ÀÚÀü¼Û¸ðµâ´Ù¿î
FORM ¼Ò½º(form.html)
Àü¼Û¸Þ¼¼Áö :
¿¹)90byte ÀÌÇÏ·Î ÀÔ·Â.
¹Þ´Â¹øÈ£ :
¿¹) 01011111111,01011111112 '-' ¾øÀÌ ÀÔ·Â.
À̸§»ðÀÔ¹øÈ£ :
¿¹) 010-000-0000|È«±æµ¿,010-000-0001|ÀÌÁ¤¿ø,
º¸³»´Â ¹øÈ£ :
¿¹ 01012341234
¿¹¾à :
¿¹¾à½Ã : Y
¿¹¾à ³¯Â¥ :
¿¹)2014-03-01 00:00:00
return url :
nointeractive :
¿¹) »ç¿ëÇÒ °æ¿ì : 1, ¼º°ø½Ã ´ëÈ»óÀÚ(alert)¸¦ »ý·«. test flag :
¿¹) Å×½ºÆ®½Ã: Y
¿¹¾à :
¿¹) ¿¹¾à½Ã : Y
¹®ÀÚÀü¼Û - ¹ß¼Û¿äû ó¸® ¼Ò½º¿¹Á¦(action.php)
if($_POST['action']=='go'){ /******************** ÀÎÁõÁ¤º¸ ********************/ $sms_url = "https://www.smcoms.com/sslsms/sms_sender.php"; // HTTPS Àü¼Û¿äû URL //$sms_url = "http://www.smcoms.com/sslsms/sms_sender.php"; // Àü¼Û¿äû URL $sms['user_id'] = base64_encode("ÇØ´ç ¾ÆÀ̵ð"); //SMS ¾ÆÀ̵ð. $sms['secure'] = base64_encode("ÇØ´ç ÀÎÁõÅ°") ;//ÀÎÁõÅ° $sms['msg'] = base64_encode(stripslashes($_POST['msg'])); //¸Þ½ÃÁö $sms['rphone'] = base64_encode($_POST['rphone']); // ¼ö½ÅÆù ¹øÈ£Á¶ÇÕ $sms['destination'] = base64_encode($_POST['destination']); // ¼ö½ÅÆù¹øÈ£,À̸§ Á¶ÇÕ $sms['sphone'] = base64_encode($_POST['sphone']); // ¹ß½ÅÆù ¹øÈ£ $sms['rdate'] = base64_encode($_POST['rdate']); // ¿¹¾à½Ã°£ $sms['resflag'] = base64_encode($_POST['resflag']); // ¿¹¾à¿©ºÎ(Y or °ø¹é) $sms['mode'] = base64_encode("1"); // base64 »ç¿ë½Ã ¹Ýµå½Ã ¸ðµå°ªÀ» 1·Î ÁÖ¼Å¾ß ÇÕ´Ï´Ù. $sms['returnurl'] = base64_encode($_POST['returnurl']); // ¸®ÅÏ URL $sms['testflag'] = base64_encode($_POST['testflag']); // Å×½ºÆ® ¿©ºÎ(Y or °ø¹é) $returnurl = $_POST['returnurl']; $nointeractive = $_POST['nointeractive']; //»ç¿ëÇÒ °æ¿ì : 1, ¼º°ø½Ã ´ëÈ»óÀÚ(alert)¸¦ »ý·« $host_info = explode("/", $sms_url); $protocol = $host_info[0]; $host = $host_info[2]; $path = $host_info[3]."/".$host_info[4]; srand((double)microtime()*1000000); $boundary = "---------------------".substr(md5(rand(0,32000)),0,10); //print_r($sms); // Çì´õ »ý¼º $header = "POST /".$path ." HTTP/1.0\r\n"; $header .= "Host: ".$host."\r\n"; $header .= "Content-type: multipart/form-data, boundary=".$boundary."\r\n"; // º»¹® »ý¼º foreach($sms AS $index => $value){ $data .="--$boundary\r\n"; $data .= "Content-Disposition: form-data; name=\"".$index."\"\r\n"; $data .= "\r\n".$value."\r\n"; $data .="--$boundary\r\n"; } $header .= "Content-length: " . strlen($data) . "\r\n\r\n"; $fp = fsockopen(($protocol=="https:" ? "ssl://" : "").$host, $protocol=="https:" ? 443 : 80); if ($fp) { fputs($fp, $header.$data); $rsp = ''; while(!feof($fp)) { $rsp .= fgets($fp,8192); } fclose($fp); $msg = explode("\r\n\r\n",trim($rsp)); $rMsg = explode(",", $msg[1]); $Result= $rMsg[0]; //¹ß¼Û°á°ú $Count= $rMsg[1]; //ÀÜ¿©°Ç¼ö $ErrorCode= $rMsg[3]; //¿¡·¯ÄÚµå //¹ß¼Û°á°ú ¾Ë¸² if($Result=="success") { $alert = "¼º°ø"; $alert .= $ResultAlert; $alert .= "ÀÜ¿©°Ç¼ö´Â ".$Count."°Ç ÀÔ´Ï´Ù."; }else if($Result=="reserved") { $alert = "¼º°øÀûÀ¸·Î ¿¹¾àµÇ¾ú½À´Ï´Ù."; $alert .= $ResultAlert; $alert .= " ÀÜ¿©°Ç¼ö´Â ".$Count."°Ç ÀÔ´Ï´Ù."; }else if($Result=="fail") { $alert = "[¹ß¼Û½ÇÆÐÀÔ´Ï´Ù ".$ErrorCode."]".$Result.$ResultAlert; }else { $alert = "[Error ".$ErrorCode."]".$Result.$ResultAlert; } } else { $alert = "Connection Failed"; } if($nointeractive=="1" && ($Result!="success" && $Result!="Test Success!" && $Result!="reserved") ) { echo ""; } else if($nointeractive!="1") { echo ""; } echo ""; }