1. Àü¼Û°æ·Î |
http://link.smsceo.co.kr/sendsms_euckr.php (charset ÀÌ euc-krÀÏ°æ¿ì) |
http://link.smsceo.co.kr/sendsms_utf8.php (charset ÀÌ utf-8ÀÏ°æ¿ì) |
1.1 Å×½ºÆ® Àü¼Û°æ·Î |
http://link.smsceo.co.kr/sendsms_test.php |
Å×½ºÆ® Àü¼Û½Ã ½ÇÁ¦ °ú±ÝÀº ÀÌ·ç¾îÁöÁö ¾ÊÀ¸¸ç °á°ú Äڵ常 º¸½Ç ¼ö ÀÖ½À´Ï´Ù. |
2. Àü´Þ°ª |
|
3. ¼ö½ÅÀÚ À̸§ ÀÚµ¿ÀÔ·Â |
phone °ªÀ» ¾Æ·¡¿Í °°ÀÌ "ÈÞ´ëÆù¹øÈ£^À̸§" °ú °°ÀÌ '^'¹®ÀÚ·Î ±¸ºÐÇؼ ÀÔ·ÂÇϽðí, msg°ª¿¡ "[*À̸§*]" À̶ó´Â ¹®±¸¸¦ ÀÔ·Â ÈÄ
Àü¼ÛÇÏ½Ã¸é µË´Ï´Ù.
¿¹)
...
<input type="type" name="phone" value="01012341234^È«±æµ¿|0113451234^±è¿µÈñ">
...
<input type="type" name="msg" value="[*À̸§*]´Ô, ÁÖ¹®ÇϽŠ¹°Ç°ÀÌ ¹è¼Û󸮵Ǿú½À´Ï´Ù.">
|
4. °á°úÄÚµå/¼³¸í ¹× Ãâ·ÂÇü½Ä |
4.1 °á°úÄÚµå/¼³¸í |
result_code |
result_msg |
1 |
¼º°ø |
2 |
ÀÎÁõÅ° ¿À·ù |
3 |
userid¿¡ ÇØ´çÇÏ´Â »ç¿ëÀÚ ¾øÀ½ |
4 |
¹Þ´Â»ç¶÷ ¹øÈ£¿À·ù
(¿Ã¹Ù¸¥ ¹øÈ£°¡ ÇѰǵµ ¾øÀ»¶§ ¸®ÅϵǸç, ¿©·¯°Ç Áß ÇÑ°ÇÀÌ¶óµµ Àü¼Û¼º°øÀ϶§ result_code´Â 1(¼º°ø)·Î ¸®Åϵ˴ϴÙ.
¼º°ø°Ç¼ö, ½ÇÆаǼö´Â succ_count, fail_count º¯¼ö¸¦ ÂüÁ¶ÇÏ½Ã¸é µË´Ï´Ù.)
|
5 |
º¸³»´Â»ç¶÷ ¹øÈ£¿À·ù |
6 |
¿¹¾à½Ã°£ ¿À·ù |
7 |
Àܾ׺ÎÁ· |
8 |
±âŸ¿À·ù |
10 |
¹Ìµî·ÏµÈ ȸ½Å¹øÈ£ |
|
|
4.2 Ãâ·ÂÇü½Ä |
return_url ÁöÁ¤½Ã |
return_url?result_code=°á°úÄÚµå&result_msg=°á°ú¸Þ¼¼Áö&total_count=ÃÑ Á¢¼ö°Ç¼ö&succ_count=¼º°ø°Ç¼ö&fail_count=½ÇÆаǼö&money=³²ÀºÀÜ¾× À¸·Î ¸®´ÙÀÌ·º¼Ç |
return_url ¹ÌÁöÁ¤½Ã |
result_code=°á°úÄÚµå&result_msg=°á°ú¸Þ¼¼Áö&total_count=ÃÑ Á¢¼ö°Ç¼ö&succ_count=¼º°ø°Ç¼ö&fail_count=½ÇÆаǼö&money=³²ÀºÀÜ¾× À» Ãâ·Â |
|
|
5. ¿¬µ¿¿¹Á¦ |
5.1 html ¿¬µ¿ ¹æ½Ä |
<form name="smsform" method="POST" action="http://link.smsceo.co.kr/sendsms_euckr.php">
<input type="hidden" name="userkey" value="ÀÎÁõÅ°">
<input type="hidden" name="userid" value="¹®ÀÚ´ëÇ¥ ¾ÆÀ̵ð">
<input type="hidden" name="msg" value="¾È³çÇϼ¼¿ä. ¹®ÀÚ´ëÇ¥ÀÔ´Ï´Ù.">
<input type="hidden" name="phone" value="01022223333">
<input type="hidden" name="callback" value="01022223333">
<input type="hidden" name="send_date" value="2011-01-11 00:00:00">
<input type="hidden" name="return_url" value="http://[°í°´´ÔÀÇ È¨ÆäÀÌÁö url]/result.htm">
<input type="hidden" name="return_var" value="">
</form>
<script>
document.smsform.submit();
</script>
form submit ¹æ½ÄÀº ¼Ò½ºº¸±â·Î ÀÎÁõÅ°°¡ ³ëÃâµÉ ¼ö ÀÖÀ¸´Ï, °ü¸®ÀÚ¸¸ Àü¼ÛÆäÀÌÁö¸¦ º¼ ¼ö ÀÖµµ·Ï ÇϽñ⠹ٶø´Ï´Ù.
|
|
5.2 php ¿¬µ¿ ¹æ½Ä |
<?
// php.ini ÆÄÀÏ¿¡¼ allow_url_fopen °ªÀÌ OnÀ¸·Î µÇ¾îÀÖ¾î¾ß ÇÕ´Ï´Ù.
// return_url º¯¼ö¿Í return_var º¯¼ö´Â »ç¿ëµÇÁö ¾Ê½À´Ï´Ù.
function sendsms($url)
{
$result = file_get_contents($url);
$result = trim($result);
parse_str($result, $result_var);
return $result_var;
}
$userkey = "ÀÎÁõÅ°";
$userid = "¹®ÀÚ´ëÇ¥ ¾ÆÀ̵ð";
$phone = "01122223333";
$callback = "01022223333";
$msg = urlencode("¾È³çÇϼ¼¿ä. ¹®ÀÚ´ëÇ¥ÀÔ´Ï´Ù.");
$send_date = urlencode("2011-01-11 00:00:00"); // ¿¹¾à¸Þ¼¼ÁöÀÏ °æ¿ì »ç¿ëÇϽñ⠹ٶø´Ï´Ù.
// ¾Æ·¡ µÎ °ªÀº »ç¿ëµÇÁö ¾Ê½À´Ï´Ù.
//$return_url = "";
//$return_var = "";
$url = "http://link.smsceo.co.kr/sendsms_euckr.php?userkey=" . $userkey;
$url .= "&userid=" . $userid;
$url .= "&phone=" . $phone;
$url .= "&callback=" . $callback;
$url .= "&msg=" . $msg;
$url .= "&send_date=" . $send_date;
$result = array();
$result = sendsms($url); // °á°ú Ãâ·ÂÇü½ÄÀ» Âü°íÇϼ¼¿ä.
// print_r($result);
if($result['result_code'] == "1") // Àü¼Û¼º°ø
{
echo "°á°úÄÚµå : " . $result['result_code'];
echo "¸Þ¼¼Áö : " . $result['result_msg'];
echo "ÃÑ Á¢¼ö°Ç¼ö : " . $result['total_count'];
echo "¼º°ø°Ç¼ö : " . $result['succ_count'];
echo "½ÇÆаǼö : " . $result['fail_count'];
echo "ÀÜ¾× : " . $result['money'];
}
else
{
echo "°á°úÄÚµå : " . $result['result_code'];
echo "¸Þ¼¼Áö : " . $result['result_msg'];
}
?>
|
|
5.3 asp ¿¬µ¿ ¹æ½Ä |
<%
Function SendSMS(url)
Dim result
Dim xmlHttp
Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlHttp.open "GET", Xurl, False
xmlHttp.setRequestHeader "Content-Type","text/xml"
xmlHttp.setRequestHeader "Accept-Language","ko"
xmlHttp.send
If xmlHttp.status = 200 then
result = xmlHttp.responseText
Else
result = "fail"
End if
Set xmlHttp = Nothing
SendSMS = result
End Function
Dim userKey, userId, phone, callback, msg, sendDate, returnUrl, returnVar, result, url
userKey = "ÀÎÁõÅ°"
userId = "¹®ÀÚ´ëÇ¥ ¾ÆÀ̵ð"
phone = "01122223333"
callback = "01022223333"
msg = Server.URLEncode("¾È³çÇϼ¼¿ä. ¹®ÀÚ´ëÇ¥ÀÔ´Ï´Ù.")
sendDate = Server.URLEncode("2011-01-11 00:00:00") ' ¿¹¾à¸Þ¼¼ÁöÀÏ °æ¿ì »ç¿ëÇϽñ⠹ٶø´Ï´Ù.
'¾Æ·¡ µÎ °ªÀº »ç¿ëµÇÁö ¾Ê½À´Ï´Ù.
'returnUrl = ""
'returnVar = ""
url = "http://link.smsceo.co.kr/sendsms_euckr.php?userkey=" & userKey;
url = url & "&userid=" & userId;
url = url & "&phone=" & phone;
url = url & "&callback=" & callback;
url = url & "&msg=" & msg;
url = url & "&send_date=" & sendDate;
result = SendSMS(url)
Response.write result °á°ú Ãâ·ÂÇü½ÄÀ» Âü°íÇϼ¼¿ä.
%>
|