성인인증 관련 질문 올립니다. 정보
성인인증 관련 질문 올립니다.본문
시작페이지 index.html ----> 인증 후 index.php
주민등록 검사 와 함께 성인인증을 할려면 어떻게 해야하는지요?
/js/wrest.js 에서 스크립트를 참조하는것 같은데요.
위 스크립 내용에 추가해서 바로 성인인증까지 가능하게 할려면 어떻게 해야 하는지요?
꼭~ 좀 부탁드립니다.
------------------------// 소스 //------------------
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4['title'] = "";
include_once("./head.sub.php");
?>
<br><br><br><br><br><br>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td align=center valign=middle>
<table width=800 cellpadding=0 cellspacing=0>
<tr>
<td width=252><img src=/images/intro_01.jpg></td>
<td width=334><img src=/images/intro_02.jpg></td>
<td width=214><img src=/images/intro_03.jpg></td>
</tr>
<tr>
<td><img src=/images/intro_04.jpg></td>
<td><img src=/images/intro_05.jpg></td>
<td><img src=/images/intro_06.jpg></td>
</tr>
<tr>
<td><img src=/images/intro_07.jpg></td>
<td><img src=/images/intro_08.jpg></td>
<td><img src=/images/intro_09.jpg></td>
</tr>
<tr>
<td><img src=/images/intro_10.jpg></td>
<td>
<!--// 성인인증 //-->
<form name=chkf method='post' action="./index.php">
<table cellpadding=0 cellspacing=0 border=0>
<tr>
<td width=80><img src=/images/text_name.gif></td>
<td><input name=chk_name type='text' tabindex=1 required hangul itemname='성명' style='border: 1px solid #888188; background-color:#eeeeee;'></td>
<td width=100 rowspan=2 align=right><input type='image' src='/images/btn_adult.gif'></td>
<td width=100 rowspan=2 align=right><a href='#' onclick='javascript:history.back();'><img src=/images/btn_child.gif></a></td>
</tr>
<tr>
<td><img src=/images/text_id.gif></td>
<td><input name=chk_code itemname="주민등록번호" tabindex=1 required jumin minlength="13" maxlength=13 class=ed style='border: 1px solid #888188; background-color:#eeeeee;'></td>
<td></td>
<td></td>
</tr>
</table>
</form>
</td>
<td><img src=/images/intro_12.jpg></td>
</tr>
<tr>
<td><img src=/images/intro_13.jpg></td>
<td><img src=/images/intro_14.jpg></td>
<td><img src=/images/intro_15.jpg></td>
</tr>
</table>
</td></tr></table>
<?
include_once("./tail.sub.php");
?>
---------------------------------------------------------------
-----------------/ js/wrest.js 의 주민등록 검사 /------------
// 주민등록번호 검사
function wrestJumin(fld)
{
if (!wrestTrim(fld)) return;
var pattern = /(^[0-9]{13}$)/;
if (!pattern.test(fld.value))
{
if (wrestFld == null)
{
wrestMsg = wrestItemname(fld) + " : 주민등록번호를 13자리 숫자로 입력하십시오.\n";
wrestFld = fld;
}
}
else
{
var sum_1 = 0;
var sum_2 = 0;
var at=0;
var juminno= fld.value;
sum_1 = (juminno.charAt(0)*2)+
(juminno.charAt(1)*3)+
(juminno.charAt(2)*4)+
(juminno.charAt(3)*5)+
(juminno.charAt(4)*6)+
(juminno.charAt(5)*7)+
(juminno.charAt(6)*8)+
(juminno.charAt(7)*9)+
(juminno.charAt(8)*2)+
(juminno.charAt(9)*3)+
(juminno.charAt(10)*4)+
(juminno.charAt(11)*5);
sum_2=sum_1 % 11;
if (sum_2 == 0)
at = 10;
else
{
if (sum_2 == 1)
at = 11;
else
at = sum_2;
}
att = 11 - at;
// 1800 년대에 태어나신 분들은 남자, 여자의 구분이 9, 0 이라는
// 얘기를 들은적이 있는데 그렇다면 아래의 구문은 오류이다.
// 하지만... 100살넘은 분들이 주민등록번호를 과연 입력해볼까?
if (juminno.charAt(12) != att ||
juminno.substr(2,2) < '01' ||
juminno.substr(2,2) > '12' ||
juminno.substr(4,2) < '01' ||
juminno.substr(4,2) > '31' ||
juminno.charAt(6) > 4)
{
wrestMsg = wrestItemname(fld) + " : 올바른 주민등록번호가 아닙니다.\n";
wrestFld = fld;
}
}
}
---------------------------------------------------------------
꼭 좀 부탁드립니다.
댓글 전체

juminno.substr(2,2) < '01' ||
juminno.substr(2,2) > '12' ||
juminno.substr(4,2) < '01' ||
juminno.substr(4,2) > '31' ||
juminno.charAt(6) > 4)
{
wrestMsg = wrestItemname(fld) + " : 올바른 주민등록번호가 아닙니다.\n";
wrestFld = fld;
}
now=new Date();
year=now.getYear();
birthyear = juminno.substr(0,2);
age = (juminno.charAt(6) > 2) ? "20"+birthyear : "19"+birthyear;
if((year-age) < 18) {
wrestMsg = wrestItemname(fld) + " : 성인이 아닙니다.\n";
wrestFld = fld;
}
테스트는 안해봤습니다~