홈페이지에 SMS 보내기 (SMS 연동 소스) 를 달아보자. :: 2007/11/23 09:51
홈페이지 또는 블로그에 SMS (문자 메세지) 보내는 소스를 설명 드리도록 하겠습니다.
일단 제가 알고 있는 방법은 두가지가 있습니다.
Cafe24 (http://www.cafe24.com)를 이용하는 방법과 문자나라 (http://www.winc7788.co.kr)를 이용하는 방법이 있는데 먼저 카페 24를 이용해 만드는 방법을 설명 드리도록 하겠습니다.
Cafe24 (http://www.cafe24.com)
먼저 회원 가입을 해야 겠죠. 그다음 상단 오른쪽 메뉴중 SMS호스팅을 신청합니다. 공짜냐구요? 이바닥에 공짜가 어디 있겠습니까?
SMS 호스팅 신청 후 소스를 받습니다.
소스는 다음과 같습니다.
<form method="post" action="http://고객아이디.cafe24.com/sms_send.php">
<input type="hidden" name="user_id" value="고객아이디"><br>
<input type="password" name="passwd" ><br>
전송메세지<input type="text" name="msg" maxlength="80"><br>
받는 번호<input type="text" name="rphone1" maxlength="3">-
<input type="text" name="rphone2" maxlength="4">-
<input type="text" name="rphone3" maxlength="4"><br>
보내는 번호<input type="text" name="sphone1" maxlength="3">-
<input type="text" name="sphone2" maxlength="4">-
<input type="text" name="sphone3" maxlength="4"><br>
예약 날짜<input type="text" name="rdate" maxlength="8"><br>
예약 시간<input type="text" name="rtime" maxlength="6"><br>
return url <input type="text" name="returnurl" maxlength="64"><br>
<!-- back step <input type="text" name="backstep" maxlength="1"><br> -->
test flag <input type="text" name="testflag" maxlength="1">
nointeractive <input type="text" name="nointeractive" maxlength="1"><br>
<input type="submit">
</form>
이 중 보이고 싶지 않는 메뉴(예를 들어 예약 전송이라던가, 아이디 입력란이라던가...)는 input type="text"를 input type="hidden"으로 바꿔 숨김으로 설정 합니다.
위의 소스중 고객아이디라고 적혀 있는곳에 아이디를 적으시고 소스를 입력 하시면 SMS발송 페이지가 완성됩니다.
이번엔 문자나라를 이용한 방법을 설명 드리도록 하겠습니다.
문자나라 (http://www.winc7788.co.kr)
이곳도 마찬가지로 회원 가입을 먼저 합니다. 문자나라의 장점은 회원 가입시 문자 전송 3건을 무료로 줍니다. 이정도면 테스트하기엔 부족함이 없으리라 봅니다.
이제 소스를 받아 오도록 합니다.
<style>
.lcd { overflow: hidden; font-family:돋움체; font-size: 9pt; border:0 solid;
color: black; background-color: #BBEFFE; width:99; height: 85}
.input {height:16px;font-size:9pt;border:1px solid silver;color:gray;}
.input_none {font-size: 12px; border: none; background-color: transparent;}
a:link { COLOR: #0B4279; FONT: 9pt 굴림; TEXT-DECORATION: none }
a:visited { COLOR: #0B4279; FONT: 9pt 굴림; TEXT-DECORATION: none }
a:hover { COLOR: #FF0000 ; FONT: 굴림; TEXT-DECORATION: none }
td { COLOR: #464400 ; FONT: 9pt 굴림; TEXT-DECORATION: none }
</style>
<script>
function DoClear(tg) {
if (tg.value == tg.defaultValue) {
tg.value = '';
}
CalByte(tg);
}
function CalByte(tg){
var curText;
var strLen;
var byteIs;
var lastByte;
var thisChar;
var escChar;
var curTotalMsg;
var okMsg;
curText = new String(tg.value);
strLen = curText.length;
byteIs = 0;
for(i=0; i<strLen; i++) {
thisChar = curText.charAt(i);
escChar = escape(thisChar);
if (escChar.length > 4) {
byteIs += 2; //특수문자 한글인 경우.
}else if(thisChar != '\r') { //개행을 제외한 이외의 경우
byteIs += 1;
}
if(byteIs > 80){
alert('[안 내] 80바이드(한글40자)를 초과하실 수 없습니다.');
thisText = curText.substring(0, i);
tg.value = thisText;
byteIs = lastByte;
break;
}
lastByte = byteIs;
}
document.all.byte.value = byteIs;
}
function ClearMsg(){
document.all.message.value = '';
CalByte(document.send_msg.message);
document.send_msg.message.focus();
}
function CheckIt(fm){
if(!fm.message.value || fm.message.value == fm.message.defaultValue){
alert("[안내] 내용을 입력하세요.");
ClearMsg();
return false;
}
if(!fm.sender.value || fm.sender.value.length < 10){
alert("[안내] 보내는 분의 전화번호를 정확히 입력하세요.");
fm.sender.focus();
return false;
}
return true;
}
</script>
<form method="post" name="send_msg" target="hidfrm" action="http://www.winc7788.co.kr/MSG/send/
web_admin_send.htm" onSubmit="return CheckIt(this)">
<table border="0" cellpadding="0" cellspacing="0" width="148">
<tr>
<td width="148" height="52" background="http://www.winc7788.co.kr/MSG/img/sms_head.gif">
<table border="0" cellpadding="0" cellspacing="0" width="148">
<tr>
<td width="148" height="30" colspan="2">
<input type="hidden" name="userid" value="문자나라아이디">
<input type="hidden" name="passwd" value="문자나라비밀번호">
<input type="hidden" name="receiver" value="받는번호">
<input type="hidden" name="end_alert" value="1">
</td>
</tr>
<tr>
<td width="78" align="right">
<input type="text" name="byte" class="input_none" value="0"
size="2" maxsize="3" readonly> byte
</td>
<td width="70" align="center">
<a href="javascript:ClearMsg()" title="내용을 지웁니다." onFocus="blur()"
onMouseOver='status="입력하신 메세지 내용을 지웁니다.";return true'
onMouseOut='status=""'><img src="http://www.winc7788.co.kr/MSG/img/del01.gif" border="0"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="148" height="98" background="http://www.winc7788.co.kr/MSG/img/sms_body.gif" align="center">
<textarea name='message' class='lcd' onclick='DoClear(this)' onselect=
'DoClear(this)' onkeydown='CalByte(this)' onchange='CalByte(this)' on
keyup='CalByte(this)'>[안내] 이곳에 메시지를 입력하세요.</textarea>
</td>
</tr>
<tr>
<td width="148" height="27" background="http://www.winc7788.co.kr/MSG/img/sms_foot1.gif" valign
="middle" align="center">
<a href="http://www.winc7788.co.kr/MSG/" target=""><font color="ye
llow">문자나라</font></a>
</td>
</tr>
<tr>
<td width="148" height="32" background="http://www.winc7788.co.kr/MSG/img/sms_foot2.gif" valign
="bottom" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="148">
<tr>
<td width="63" align="center">
<font color="gray">보내는분:</font>
</td>
<td width="85" align="left">
<input type="text" name="sender" size="11" maxlength="
11" style="ime-mode:disabled" class="input" value="">
</td>
</tr>
<tr>
<td width="148" height="5" colspan="2">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="148" height="5" align="center">
</td>
</tr>
<tr>
<td width="148" height="32" align="center">
<input type="image" src="http://www.winc7788.co.kr/MSG/img/msg_send_button.gif">
</td>
</tr>
</table></form>
<iframe src="" name=hidfrm marginwidth=0 marginheight=0 height=0 width=0 scrolling=no
border=0 frameborder=0></iframe>
이 중 문자나라아이디, 문자나라비밀번호, 받는번호만 바꾸신 후 소스를 입력 하시면 됩니다.
일부 블로그중엔 안될수도 있습니다. 왜냐하면 스킨에 따라 안되는 경우가 있습니다. 이 부분에 대해서는 저도 모르겠네요. 이럴땐 새창열기로 만드시는것이 좋을것 같습니다.
'강좌 및 자료' 카테고리의 다른 글
| CPU 확인 프로그램 CPU-Z (내 컴퓨터의 CPU를 확인해봅시다) (2) | 2008/02/14 |
|---|---|
| 네임서버 변경후 화면에 test라는 글씨만 보일때 대처 방법 (2) | 2008/01/05 |
| 이미지를 텍스트로 바꿔주는 프로그램 (4) | 2007/12/10 |
| 로보트 만들기 (페이퍼크레프트) Zenith (0) | 2007/11/27 |
| 종이접기 250종 셋트 모음 (0) | 2007/11/26 |
| 홈페이지에 SMS 보내기 (SMS 연동 소스) 를 달아보자. (4) | 2007/11/23 |
| 블로그포털 사이트를 만들어 봅시다. (0) | 2007/11/13 |
| FTP의 최강자 File Zilla 3.0.2.1 (파일질라 3.0.2.1) (0) | 2007/11/01 |
| 웹깨비 (APM 프로그램) 전면 무료화 단행 (0) | 2007/10/23 |
| 블로그에 사용하기 좋은 숫자 아이콘 (0) | 2007/10/17 |
| RoHS와 PoHS에 대해 알아 보자 (6) | 2007/10/10 |
오늘 이메일이 왔습니다. 우체국보험에서 왔더라구요. 하지만 저는 우체국보험에 가입된 적이 없습니다. 이메일을 열어보니 아니나 다를까 제 이름이 아닌 다른 사람의 이름으로 메일이 왔습니다. 처음에는 그냥 가입자의 실수인가보다....
처음 이 사이트를 들어 갔을때 구글인줄 알았습니다. 첫 페이지의 설렁함, Logo의 색상, 검색창의 형태, 우측 상단의 메뉴까지 정말로 구글과 너무나도 흡사한 사이트였습니다. 무슨 사이트인가 찾아 봤더니 CPC광고 사이트였습니..
한 사이트를 통해 "한사람의 미래를 위해서 5천원을 빌려주실 분들을 찾습니다." 라는 카피문구를 보게 되었습니다. 이 사이트는 제가 개인적으로 자주 사용하는 "Free SMS" 라는 프로그램을 제작한 사이트인데 그의 놀라운 프..
티스토리 공지사항에 설문조사 참여하라는 말이 있길래 시간도 남고 해서 커피 한잔 마시며 설문조사에 참여했습니다. 뭐 한두 페이지는 그럭저럭 괜찮았습니다. 그냥 일반적인 질문이었고 나름해도 대답에 대한 의양이 있었습니다. 그런데..
제 지난 포스트 (2008/10/23 - [노출 광고 이야기] - 올블릿 돈받기 힘들구나) 를 보신분이라면 아시겠지만 3만원 채우고 돈 못받아서 A2님의 말씀대로 문의 센터에 문의를 했더니 6일만에 답변 메일이 왔습니다. 보통..
현재 이 블로그에는 구글광고가 달려있습니다만 제 블로그중 또 다른 블로그에는 올블로그의 올블릿 광고가 달려 있습니다. 아시는 분들은 다 아시겠지만 사실 한국 광고는 (올블로그의 올블릿이나 다음 애드클릭스, 링크프라이스 등) 돈..




