[etc] 성인인증 페이지 구성
  
 작성자 :
작성일 : 2010-03-05     조회 : 2,087  

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<SCRIPT language=JavaScript>
<!--
function jumin_QC()
{
var chk =0;

var yy = document.jumin_form.jumin1.value.substring(0,2);

var mm = document.jumin_form.jumin1.value.substring(2,4);

var dd = document.jumin_form.jumin1.value.substring(4,6);

var sex = document.jumin_form.jumin2.value.substring(0,1);



var gijun_date = 810101;// 옆의 숫자는 1981년 1월 1일 이후 출생자는 성인이 아닌것으로 판단


if (document.jumin_form.jumin2.value.split(" ").join("") == "") {

alert ('주민등록번호를 입력하여 주세요.');

document.jumin_form.jumin1.focus();

return false;

}





if (document.jumin_form.jumin1.value.length!=6)

{

alert ('주민등록번호 앞자리를 입력하여 주세요.');

document.jumin_form.jumin1.focus();

return false;

}



if (document.jumin_form.jumin2.value.length != 7 )

{

alert ('주민등록번호 뒷자리를 입력하여 주세요.');

document.jumin_form.jumin2.focus();

return false;

}





if (isNaN(document.jumin_form.jumin1.value) || isNaN(document.jumin_form.jumin2.value))

{

document.jumin_form.jumin1.value = ""

document.jumin_form.jumin2.value = ""

alert('주민등록번호는 숫자만 가능합니다.');

return false;

}

if ((document.jumin_form.jumin1.value.length!=6)||(mm <1||mm>12||dd<1)){

document.jumin_form.jumin1.value = ""

alert ('주민등록번호 앞자리를 잘못 입력하였습니다..');

document.jumin_form.jumin1.focus();

return false;

}







if ((sex != 1 && sex !=2 )||(document.jumin_form.jumin2.value.length != 7 )){

document.jumin_form.jumin2.value = ""

alert ('주민등록번호 뒷자리를 잘못 입력하였습니다.');

document.jumin_form.jumin2.focus();

return false;

}


for (var i = 0; i <=5 ; i++){

chk = chk + ((i%8+2) * parseInt(document.jumin_form.jumin1.value.substring(i,i+1)))

}

for (var i = 6; i <=11 ; i++){

chk = chk + ((i%8+2) * parseInt(document.jumin_form.jumin2.value.substring(i-6,i-5)))

}

chk = 11 - (chk %11)

chk = chk % 10



if (chk != document.jumin_form.jumin2.value.substring(6,7))

{

document.jumin_form.jumin1.value = ""

document.jumin_form.jumin2.value = ""

alert ('올바른 주민등록번호가 아닙니다.');

document.jumin_form.jumin1.focus();

return false;

}
if (document.jumin_form.jumin1.value < gijun_date)

{

document.jumin_form.jumin1.focus();

document.location="http://towe.nple.com/towe";//이곳에 성인인증후 이동할 문서의 경로 설정. 바꿔주세요 -_-;

return false;



}

else

{

alert ('성인이 아니므로 들어오실 수 없습니다.');

document.jumin_form.jumin1.focus();

return false;

}

return true;

}

//입력필드 자동 이동

function auto_Move(obj)

{

if (obj.value.length > 5)

{

jumin_form.jumin2.focus();

}

}



function prev_move(obj)

{

if (obj.value.length == 0)

{

jumin_form.jumin1.focus();

}

}



function right(e)

{

if ((navigator.appName == "Netscape") && (e.which == 3 || e.which == 2))

{

return false;

}

else if ((navigator.appName == "Microsoft Internet Explorer") && (event.button == 2 || event.button == 3))

{

alert("미성년자는 접속할 수 없습니다.");

return false;

}

return true;

}



document.onmousedown=right;

-->

</SCRIPT>


</HEAD>

<BODY>
<!--아래와 같이 폼 태그를 구성하세요-->
<form method=get name=jumin_form onSubmit="return jumin_QC()">
주민등록번호 입력:
<input maxlength=6 name=jumin1 onFocus="this.value = this.value;" onKeyUp=auto_Move(this); size="7">-
<input maxlength=7 name=jumin2 onKeyUp=prev_move(this); size=8>
<input name=send type=submit value="성인인증">
<br><b>주민등록번호는 저장이 되지 않습니다.!</b></p>
</form>

</FORM>
</BODY>
</HTML>