ÅëÇÕ°Ë»ö
¡¤ ¸¶À»¼­ºñ½º¶õ?  ¡¤ Æ÷·³¸¶À»  ¡¤ ÀϹݸ¶À»  ¡¤ Å׸¶¸¶À»  ¡¤ ¸¶À»·©Å·  ¡¤ Ȱµ¿¿Õ
¡¤ µ¦½ºÆÛÆ®¶õ?  ¡¤ TECBOX   ¡¤ PRSBOX   ¡¤ ÀÌ¿ë¾È³»  
¡¤ DEXTÁ¦Ç°±º  ¡¤ ¼Ö·ç¼Çº£ÀÌ  ¡¤ S/W & ESD ÄÄÆ÷³ÍÆ®
¡¤ ÇÁ·Î±×·¥º£ÀÌ
¡¤ LiveSeminar  ¡¤ LiveConference
µ¥ºêÇÇ¾Æ C# Æ÷·³ ¸¶À»¿¡ ¿À½Å °ÍÀ» ȯ¿µÇÕ´Ï´Ù.
  ¸¶À»µî±Þ C#   ÀÌ ¸¶À»Àº Æ÷·³¸¶À» ÀÔ´Ï´ÙÀÌ ¸¶À»Àº ÀÚÀ¯°¡ÀÔÁ¦ ¸¶À» ÀÔ´Ï´Ù ¸¶À»¼Ò°³ ÆäÀÌÁö·Î À̵¿ ÀüÀÔ½Åû
¸¶À»ÃÌÀåÃÌÀå ºñ»ç¸ð ÁֹΠ12761 since 2006-12-28
¿ì¸®¸¶À» °øÁö»çÇ×
Áú¹®&´äº¯
°­ÁÂ&ÆÁ
ÀÚÀ¯°Ô½ÃÆÇ
ÀÚ·á½Ç
¾Ù¹ü
°³ÀÎ°Ô½ÃÆÇ
[¸¶À» °Ô½ÃÆÇ]
±¸ÀÎ/±¸Á÷ °Ô½ÃÆÇ
°ÇÀÇ / ¿î¿µ Á¦¾È
¶ûµ¥ºê °Ô½ÃÆÇ
Ä®·³ °Ô½ÃÆÇ
°³¹ßÀÚ °íÃæ»ó´ã
Dev Talk
ÀÚÀ¯Åä·Ð¹æ
º­·è½ÃÀå
À糪¹Ì ¿ì½º°³
±¸ÀÎ/ÇÁ·ÎÁ§Æ® Á¤º¸
»ç¶÷ÀΠä¿ë °Ô½ÃÆÇ
  °í°´Áö¿ø °Ô½ÃÆÇ
¸¶ÀÌ µ¥ºêÇǾÆ
 ³ªÀÇ e-Money ³»¿ª
 È°µ¿¿Õ My Page
 ½ºÅ©·¦ÇÑ °Ô½Ã±Ûº¸±â
 ÂÊÁö°ü¸®
 Áּҷϰü¸®

 Áú¹®&´äº¯ ¡Ø ²À ´äº¯Ã¤ÅÃÀ» ÇØÁÖ½Ã¾î ¼ºÀDz¯ ´äº¯ÇØÁֽŠȸ¿ø´Ô²² °¨»çÀÇ ¸¶À½À» ÀüÇÏ½Ã±æ ¹Ù¶ø´Ï´Ù.
 Cafe24 SMSÈ£½ºÆÃÀ» »ç¿ëÇÏ¿© ¹®ÀÚ¸Þ½ÃÁö¸¦ ¹ß¼ÛÇÏ·Á°í ÇÕ´Ï´Ù.  | Network Program 2013-10-10 ¿ÀÈÄ 3:04:13
 4winners  4winners´Ô²² ¸Þ½ÃÁö º¸³»±â4winners´ÔÀ» ³» ÁÖ¼Ò·Ï¿¡ Ãß°¡ÇÕ´Ï´Ù.4winners´ÔÀÇ °³ÀÎ°Ô½ÃÆÇ °¡±â ¹øÈ£: 156525 Ãßõ:0  / ÀÐÀ½:0

»ùÇüҽº°¡ ASP, JSP, PHP¸¸ ÀÖ¾î ÇØ´ç ½ºÅ©¸³Æ®¸¦ ºÐ¼®ÇÏ¿© ¹®ÀÚ¸Þ½ÃÁö¸¦ º¸³»·Á°í ÇÕ´Ï´Ù.

 

ÇØ´ç »ùÇüҽº¸¦ º¸¸é POST ¸Þ½ÃÁö·Î º¸³»°í Àֱ⠶§¹®¿¡

 

WebRequest¸¦ ÀÌ¿ëÇÏ¿© POST ¸Þ½ÃÁö¸¦ ¸¸µé¾î º¸³»¸é µÉµí Çѵ¥

 

½±Áö°¡ ¾Ê³×¿ä Ȥ½Ã Cafe24 SMS¸¦ Windows ¾îÇø®ÄÉÀ̼ǿ¡¼­ º¸³»º¸½ÅºÐ ÀÖÀ¸½Å°¡¿ä?

 

°í¼öºÐµéÀÇ µµ¿òÀ» ºÎŹ µå¸³´Ï´Ù. (_._) ²Ù»¶

 

ÇØ´ç »ùÇüҽº ÀÔ´Ï´Ù.

 

JSP À¥Æû ÄÚµå

 

<html>
 <html>
  <form method="post" action="¹ß¼Ûó¸®URL">
     <input type="hidden" name="action" value="go">
     Àü¼Û¸Þ¼¼Áö <input type="text" name="msg" maxlength="80" size=80> ¿¹)80byte ÀÌÇÏ·Î ÀÔ·Â.
     <br>¹Þ´Â ¹øÈ£ <input type="text" name="rphone" value="011-111-1111"> ¿¹) 011-111-1111 , '-' Æ÷ÇÔÇØ¼­ ÀÔ·Â.
     <br>À̸§»ðÀÔ¹øÈ£ <input type="text" name="destination" value="" size=80> ¿¹) 010-000-0000|È«±æµ¿
  <br>
     º¸³»´Â ¹øÈ£<input type="text" name="sphone1" maxlength="4" value="011">-
     <input type="text" name="sphone2" maxlength="4" value="111">-
     <input type="text" name="sphone3" maxlength="4" value="1111">
     <br>¿¹¾à ³¯Â¥ <input type="text" name="rdate" maxlength="8"> ¿¹)20090909
     <br>¿¹¾à ½Ã°£ <input type="text" name="rtime" maxlength="6"> ¿¹)173000 ,¿ÀÈÄ 5½Ã 30ºÐ,¿¹¾à½Ã°£Àº ÃÖ¼Ò 10ºÐ ÀÌ»óÀ¸·Î ¼³Á¤.
     <br>return url <input type="text" name="returnurl" maxlength="64" value="http://*****.cafe24.com" >
    <br> test flag <input type="text" name="testflag" maxlength="1"> ¿¹) Å×½ºÆ®½Ã: Y
     <br>nointeractive <input type="text" name="nointeractive" maxlength="1"> ¿¹) »ç¿ëÇÒ °æ¿ì : 1, ¼º°ø½Ã ´ëÈ­»óÀÚ(alert)¸¦ »ý·«.
     <br>¹Ýº¹¼³Á¤ <input type="checkbox" name="repeatFlag" value="Y">
    <br> ¹Ýº¹È½¼ö <select name="repeatNum">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            </select> ¿¹) 1~10ȸ °¡´É.
     <br>Àü¼Û°£°Ý<select name="repeatTime"> ¿¹)15ºÐ ÀÌ»óºÎÅÍ °¡´É.
            <option value="15">15</option>
            <option value="20">20</option>
            <option value="25">25</option>
            </select>ºÐ¸¶´Ù
            <br>
     <input type="submit" value="Àü¼Û">
     <br/>ÀÌÅë»ç Á¤Ã¥¿¡ µû¶ó ¹ß½Å¹øÈ£¿Í ¼ö½Å¹øÈ£°¡ °°Àº °æ¿ì ¹ß¼ÛµÇÁö ¾Ê½À´Ï´Ù.
  </form>
</html>

 

 

¹®ÀÚ ¹ß¼Û À¥½ºÅ©¸³Æ® ¼Ò½º

 


<%@ page language="java" import="java.util.*, java.security.*, java.io.*, java.net.*" %>
<%!
/**====================================================================================
  Description        :  »ç¿ë ÇÔ¼ö ¼±¾ð
====================================================================================**/
 /**
 * nullcheck
 * @param str, Defaultvalue
 * @return
 */

 public static String nullcheck(String str,  String Defaultvalue ) throws Exception
 {
      String ReturnDefault = "" ;
      if (str == null)
      {
          ReturnDefault =  Defaultvalue ;
      }
      else if (str == "" )
     {
          ReturnDefault =  Defaultvalue ;
      }
      else
      {
                  ReturnDefault = str ;
      }
       return ReturnDefault ;
 }
 /**
 * BASE64 Encoder
 * @param str
 * @return
 */
public static String base64Encode(String str)  throws java.io.IOException {
    sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
    byte[] strByte = str.getBytes();
    String result = encoder.encode(strByte);
    return result ;
}

/**
 * BASE64 Decoder
 * @param str
 * @return
 */
public static String base64Decode(String str)  throws java.io.IOException {
    sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
    byte[] strByte = decoder.decodeBuffer(str);
    String result = new String(strByte);
    return result ;
}
%>
<%
/**====================================================================================
  Description        : ij¸¯Åͼ Á¤ÀÇ
  EUC-KR: @ page contentType="text/html;charset=EUC-KR
  UTF-8: @ page contentType="text/html;charset=UTF-8
====================================================================================**/
%>
<%@ page contentType="text/html;charset=EUC-KR"%>
<%
/**====================================================================================
  Description        :  »ç¿ëÀÚ »ùÇÃÄÚµå
====================================================================================**/
String charsetType = "EUC-KR"; //EUC-KR ¶Ç´Â UTF-8

request.setCharacterEncoding(charsetType);
response.setCharacterEncoding(charsetType);
String  action     = nullcheck(request.getParameter("action"), "");
if(action.equals("go")) {

 String sms_url = "";
    sms_url = "http://sslsms.cafe24.com/sms_sender.php"; // SMS Àü¼Û¿äû URL
    String user_id = base64Encode("*******"); // SMS¾ÆÀ̵ð
    String secure = base64Encode("*******");//ÀÎÁõŰ
    String msg = base64Encode(nullcheck(request.getParameter("msg"), ""));
    String rphone = base64Encode(nullcheck(request.getParameter("rphone"), ""));
    String sphone1 = base64Encode(nullcheck(request.getParameter("sphone1"), ""));
    String sphone2 = base64Encode(nullcheck(request.getParameter("sphone2"), ""));
    String sphone3 = base64Encode(nullcheck(request.getParameter("sphone3"), ""));
    String rdate = base64Encode(nullcheck(request.getParameter("rdate"), ""));
    String rtime = base64Encode(nullcheck(request.getParameter("rtime"), ""));
    String mode = base64Encode("1");
    String testflag = base64Encode(nullcheck(request.getParameter("testflag"), ""));
    String destination = base64Encode(nullcheck(request.getParameter("destination"), ""));
    String repeatFlag = base64Encode(nullcheck(request.getParameter("repeatFlag"), ""));
    String repeatNum = base64Encode(nullcheck(request.getParameter("repeatNum"), ""));
    String repeatTime = base64Encode(nullcheck(request.getParameter("repeatTime"), ""));
    String returnurl = nullcheck(request.getParameter("returnurl"), "");
    String nointeractive = nullcheck(request.getParameter("nointeractive"), "");

    String[] host_info = sms_url.split("/");
    String host = host_info[2];
    String path = "/" + host_info[3];
    int port = 80;

    // µ¥ÀÌÅÍ ¸ÊÇÎ º¯¼ö Á¤ÀÇ
    String arrKey[]
        = new String[] {"user_id","secure","msg", "rphone","sphone1","sphone2","sphone3","rdate","rtime"
                                ,"mode","testflag","destination","repeatFlag","repeatNum", "repeatTime"};
    String valKey[]= new String[arrKey.length] ;
    valKey[0] = user_id;
    valKey[1] = secure;
    valKey[2] = msg;
    valKey[3] = rphone;
    valKey[4] = sphone1;
    valKey[5] = sphone2;
    valKey[6] = sphone3;
    valKey[7] = rdate;
    valKey[8] = rtime;
    valKey[9] = mode;
    valKey[10] = testflag;
    valKey[11] = destination;
    valKey[12] = repeatFlag;
    valKey[13] = repeatNum;
    valKey[14] = repeatTime;

    String boundary = "";
    Random rnd = new Random();
    String rndKey = Integer.toString(rnd.nextInt(32000));
    MessageDigest md = MessageDigest.getInstance("MD5");
    byte[] bytData = rndKey.getBytes();
    md.update(bytData);
    byte[] digest = md.digest();
    for(int i =0;i<digest.length;i++)
    {
        boundary = boundary + Integer.toHexString(digest[i] & 0xFF);
    }
    boundary = "---------------------"+boundary.substring(0,10);

    // º»¹® »ý¼º
    String data = "";
    String index = "";
    String value = "";
    for (int i=0;i<arrKey.length; i++)
    {
        index =  arrKey[i];
        value = valKey[i];
        data +="--"+boundary+"\r\n";
        data += "Content-Disposition: form-data; name=\""+index+"\"\r\n";
        data += "\r\n"+value+"\r\n";
        data +="--"+boundary+"\r\n";
    }

    //out.println(data);

    InetAddress addr = InetAddress.getByName(host);
    Socket socket = new Socket(host, port);
    // Çì´õ Àü¼Û
    BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), charsetType));
    wr.write("POST "+path+" HTTP/1.0\r\n");
    wr.write("Content-Length: "+data.length()+"\r\n");
    wr.write("Content-type: multipart/form-data, boundary="+boundary+"\r\n");
    wr.write("\r\n");

    // µ¥ÀÌÅÍ Àü¼Û
    wr.write(data);
    wr.flush();

    // °á°ú°ª ¾ò±â
    BufferedReader rd = new BufferedReader(new InputStreamReader(socket.getInputStream(),charsetType));
    String line;
    String alert = "";
    ArrayList tmpArr = new ArrayList();
    while ((line = rd.readLine()) != null) {
        tmpArr.add(line);
    }
    wr.close();
    rd.close();

    String tmpMsg = (String)tmpArr.get(tmpArr.size()-1);
    String[] rMsg = tmpMsg.split(",");
    String Result= rMsg[0]; //¹ß¼Û°á°ú
    String Count= ""; //ÀÜ¿©°Ç¼ö
    if(rMsg.length>1) {Count= rMsg[1]; }

    //¹ß¼Û°á°ú ¾Ë¸²
    if(Result.equals("success")) {
        alert = "¼º°øÀûÀ¸·Î ¹ß¼ÛÇÏ¿´½À´Ï´Ù.";
        alert += " ÀÜ¿©°Ç¼ö´Â "+ Count+"°Ç ÀÔ´Ï´Ù.";
    }
    else if(Result.equals("reserved")) {
        alert = "¼º°øÀûÀ¸·Î ¿¹¾àµÇ¾ú½À´Ï´Ù";
        alert += " ÀÜ¿©°Ç¼ö´Â "+ Count+"°Ç ÀÔ´Ï´Ù.";
    }
    else if(Result.equals("3205")) {
        alert = "À߸øµÈ ¹øÈ£Çü½ÄÀÔ´Ï´Ù.";
    }
    else {
        alert = "[Error]"+Result;
    }

    out.println(nointeractive);

    if(nointeractive.equals("1") && !(Result.equals("Test Success!")) && !(Result.equals("success")) && !(Result.equals("reserved")) ) {
        out.println("<script>alert('" + alert + "')</script>");
    }
    else if(!(nointeractive.equals("1"))) {
        out.println("<script>alert('" + alert + "')</script>");
    }


    out.println("<script>location.href='"+returnurl+"';</script>");
}
%>

 

 

 

 

 

 

ÀÌ ±Û¿¡ ´äº¯ µî·ÏÇϱâ
¸ñ·Ï º¸±â   Áö±Ý º¸°í °è½Ã´Â ±ÛÀ» ȸ¿ø´ÔÀÇ my Mblog >> ½ºÅ©·¦¿¡ ³Ö¾îµÎ°í ´ÙÀ½¿¡ ¹Ù·Î º¸½Ç ¼ö ÀÖ½À´Ï´Ù.  
ȸ»ç¼Ò°³  |   °³ÀÎÁ¤º¸Ãë±Þ¹æÄ§  |  Á¦ÈÞ¹®ÀÇ  |   ±¤°í¹®ÀÇ  |   E-Mail ¹«´Ü¼öÁý°ÅºÎ  |   °í°´Áö¿ø  |   ÀÌ¿ë¾È³»  |   ¼¼±Ý°è»ê¼­
»ç¾÷ÀÚµî·Ï¹øÈ£ ¾È³»: 220-81-90008 / Åë½ÅÆÇ¸Å¾÷½Å°í¹øÈ£ Á¦ 2017-¼­¿ï±¸·Î-0055È£ / ´ëÇ¥: È«¿µÁØ, ¼­¹ÎÈ£
08390, ¼­¿ï½Ã ±¸·Î±¸ µðÁöÅзÎ32±æ 30, 1211È£ / TEL. 02_6719_6200 / FAX. 02-6499-1910
Copyright ¨Ï (ÁÖ) µ¥ºêÇǾÆ. All rights reserved.