게시판에 글이 등록되면 해당번호에게 문자가 가게되게 만들었는데요,
이렇게 말고
자유게시판에 글등록하면 --->010-2222-4444
공지사항 글등록하면----->010-4444-6666
로 문자가 가게 할순없나요?
테이블명으로 분류할순있을거같은데
입력방법을 모르겠네요.
혹시 아시는분계신가요?
제가 사용한 소스는 아래와 같습니다.
6번째 줄에 제 번호를 넣었고 조금 더 아래 문자전송내용을 수정하였습니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/lib/sms.lib.php");
$mb_hp = "010-2430-5710"; // 받는사람
$cf_phone = ""; // 보내는사람
//문자시작
$sms4 = sql_fetch("select * from sms4_config");
$mh_message = "{$ol_kind} 이원기 {$ol_name}님 게시판에 글이 등록되었습니다. 확인해주세요.";
$mh_hp = explode(',', $mb_hp);
// 핸드폰 번호만 걸러낸다.
$tmp = array();
for ($i=0; $i<count($mh_hp); $i++)
{
$hp = trim($mh_hp[$i]);
$hp = get_hp($hp);
if ($hp)
$tmp[][bk_hp] = get_hp($hp, 0);
}
$mh_hp = $tmp;
$total = count($mh_hp);
$mh_reply = str_replace("-", "", $cf_phone);;
if (!check_string($mh_reply, _G4_NUMERIC_))
alert("보내는 번호가 올바르지 않습니다.");
$SMS = new SMS4;
$SMS->SMS_con($sms4[cf_ip], $sms4[cf_id], $sms4[cf_pw], $sms4[cf_port]);
$result = $SMS->Add($mh_hp, $mh_reply, '', '', $mh_message, $booking, $total);
$is_success = null;
if ($result)
{
$result = $SMS->Send();
if ($result) //SMS 서버에 접속했습니다.
{
foreach ($SMS->Result as $result)
{
list($hp, $code) = explode(":", $result);
if (substr($code,0,5) == "Error")
{
$is_success = false;
$hs_code = substr($code,6,2);
switch (substr($code,6,2)) {
case '02': // "02:형식오류"
$mh_log = "형식이 잘못되어 전송이 실패하였습니다.";
break;
case '23': // "23:인증실패,데이터오류,전송날짜오류"
$mh_log = "데이터를 다시 확인해 주시기바랍니다.";
break;
case '97': // "97:잔여코인부족"
$mh_log = "잔여코인이 부족합니다.";
break;
case '98': // "98:사용기간만료"
$mh_log = "사용기간이 만료되었습니다.";
break;
case '99': // "99:인증실패"
$mh_log = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요.";
break;
default: // "미 확인 오류"
$mh_log = "알 수 없는 오류로 전송이 실패하었습니다.";
break;
}
}
else
{
$is_success = true;
$mh_log = "{$ol_name}님 핸드폰문의";
}
$hp = get_hp($hp, 1);
$log = array_shift($SMS->Log);
$row2 = sql_fetch("select max(wr_no) as wr_no from sms4_write");
if ($row2)
$wr_no = $row2[wr_no] + 1;
sql_query("insert into sms4_history set wr_no='$wr_no', wr_renum=0, bg_no='0', mb_id='$mb_id', bk_no='0', hs_name='$ol_name', hs_hp='$hp', hs_datetime='$g4[time_ymdhis]', hs_flag='1', hs_code='$hs_code', hs_memo='$mh_log', hs_log='$log'");
if ($is_admin == 'super')
$sms4[cf_point] = 0;
if ($is_success)
insert_point($member[mb_id], (-1) * $sms4[cf_point], "$mh_log");
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
sql_query("insert into sms4_write set wr_no='$wr_no', wr_renum=0, wr_reply='$cf_phone', wr_message='$mh_message', wr_total='1', wr_datetime='$g4[time_ymdhis]',wr_success='1'");
}
else alert("에러: SMS 서버와 통신이 불안정합니다.");
}
else alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다.");
?>
이렇게 말고
자유게시판에 글등록하면 --->010-2222-4444
공지사항 글등록하면----->010-4444-6666
로 문자가 가게 할순없나요?
테이블명으로 분류할순있을거같은데
입력방법을 모르겠네요.
혹시 아시는분계신가요?
제가 사용한 소스는 아래와 같습니다.
6번째 줄에 제 번호를 넣었고 조금 더 아래 문자전송내용을 수정하였습니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/lib/sms.lib.php");
$mb_hp = "010-2430-5710"; // 받는사람
$cf_phone = ""; // 보내는사람
//문자시작
$sms4 = sql_fetch("select * from sms4_config");
$mh_message = "{$ol_kind} 이원기 {$ol_name}님 게시판에 글이 등록되었습니다. 확인해주세요.";
$mh_hp = explode(',', $mb_hp);
// 핸드폰 번호만 걸러낸다.
$tmp = array();
for ($i=0; $i<count($mh_hp); $i++)
{
$hp = trim($mh_hp[$i]);
$hp = get_hp($hp);
if ($hp)
$tmp[][bk_hp] = get_hp($hp, 0);
}
$mh_hp = $tmp;
$total = count($mh_hp);
$mh_reply = str_replace("-", "", $cf_phone);;
if (!check_string($mh_reply, _G4_NUMERIC_))
alert("보내는 번호가 올바르지 않습니다.");
$SMS = new SMS4;
$SMS->SMS_con($sms4[cf_ip], $sms4[cf_id], $sms4[cf_pw], $sms4[cf_port]);
$result = $SMS->Add($mh_hp, $mh_reply, '', '', $mh_message, $booking, $total);
$is_success = null;
if ($result)
{
$result = $SMS->Send();
if ($result) //SMS 서버에 접속했습니다.
{
foreach ($SMS->Result as $result)
{
list($hp, $code) = explode(":", $result);
if (substr($code,0,5) == "Error")
{
$is_success = false;
$hs_code = substr($code,6,2);
switch (substr($code,6,2)) {
case '02': // "02:형식오류"
$mh_log = "형식이 잘못되어 전송이 실패하였습니다.";
break;
case '23': // "23:인증실패,데이터오류,전송날짜오류"
$mh_log = "데이터를 다시 확인해 주시기바랍니다.";
break;
case '97': // "97:잔여코인부족"
$mh_log = "잔여코인이 부족합니다.";
break;
case '98': // "98:사용기간만료"
$mh_log = "사용기간이 만료되었습니다.";
break;
case '99': // "99:인증실패"
$mh_log = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요.";
break;
default: // "미 확인 오류"
$mh_log = "알 수 없는 오류로 전송이 실패하었습니다.";
break;
}
}
else
{
$is_success = true;
$mh_log = "{$ol_name}님 핸드폰문의";
}
$hp = get_hp($hp, 1);
$log = array_shift($SMS->Log);
$row2 = sql_fetch("select max(wr_no) as wr_no from sms4_write");
if ($row2)
$wr_no = $row2[wr_no] + 1;
sql_query("insert into sms4_history set wr_no='$wr_no', wr_renum=0, bg_no='0', mb_id='$mb_id', bk_no='0', hs_name='$ol_name', hs_hp='$hp', hs_datetime='$g4[time_ymdhis]', hs_flag='1', hs_code='$hs_code', hs_memo='$mh_log', hs_log='$log'");
if ($is_admin == 'super')
$sms4[cf_point] = 0;
if ($is_success)
insert_point($member[mb_id], (-1) * $sms4[cf_point], "$mh_log");
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
sql_query("insert into sms4_write set wr_no='$wr_no', wr_renum=0, wr_reply='$cf_phone', wr_message='$mh_message', wr_total='1', wr_datetime='$g4[time_ymdhis]',wr_success='1'");
}
else alert("에러: SMS 서버와 통신이 불안정합니다.");
}
else alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다.");
?>
댓글 4개
게시글 목록
| 번호 | 제목 |
|---|---|
| 284508 | |
| 284499 | |
| 284492 | |
| 284490 | |
| 284484 | |
| 284481 | |
| 284478 | |
| 284476 | |
| 284474 | |
| 284472 | |
| 284470 | |
| 284458 | |
| 284457 | |
| 284454 | |
| 284453 | |
| 284447 | |
| 284446 | |
| 284444 | |
| 284441 | |
| 284440 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기