<!--#include file="../Inc/Conn.asp"-->
<!--#include file="../Inc/Function.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content="IP地址查询,ip数据库,手机号码归属地,邮政编码,长途电话区号,身份证号码验证,世界时间,万年历,">
<meta name="keywords" content="ip,查ip,ip查询,ip,IP地址查询,ip数据库,手机号码归属地,邮政编码,长途电话区号,身份证号码验证,世界时间,万年历">
<title>身份证号搜索 - ip,查ip、IP查询 查IP地址 ip数据库 手机号码归属地、邮政编码 身份证号码验证、便民查询网</title>
<link href="/Skins/Style_1.css" rel="stylesheet" type="text/css">
<STYLE type=text/css>
A:link {
	COLOR: #1c5f82; TEXT-DECORATION: none
}
A:visited {
	COLOR: #1c5f82; TEXT-DECORATION: none
}
A:hover {
	COLOR: #cc5533; TEXT-DECORATION: underline
}
.subt {
	COLOR: #aa3333; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
}
.tdc {
	COLOR: #333333; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
}
.tdc1 {
	COLOR: #ffffff; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
}
.tdc2 {
	COLOR: #008000; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
}
.tdc3 {
	COLOR: #0000ff; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
}
.bdtj {
	BACKGROUND: #3B6DC4; BORDER-BOTTOM: #3B6DC4 1px solid; BORDER-LEFT: #3B6DC4 1px solid; BORDER-RIGHT: #3B6DC4 1px solid; BORDER-TOP: #3B6DC4 1px solid; COLOR: #ffffff; FONT-SIZE: 9pt; HEIGHT: 18px
}
BODY {
	SCROLLBAR-HIGHLIGHT-COLOR: #f7f7f7; SCROLLBAR-SHADOW-COLOR: #f7f7f7; SCROLLBAR-ARROW-COLOR: #EFF1F3; SCROLLBAR-TRACK-COLOR: #EFF1F3; SCROLLBAR-BASE-COLOR: #f7f7f7
}
.tdc4 {	COLOR: #333333; FONT-SIZE: 9pt
}
</STYLE>
</head>

<body>
<font class="tdc4">
<!--#include virtual="/Inc/Head.asp" -->
</font>
<table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="50">&nbsp;</td>
  </tr>
  <tr>
    <td><div align="center">
        <TABLE border=1 borderColor=#3366cc cellPadding=4 style="BORDER-COLLAPSE: collapse" width=520>
          <TR> 
            <TD align=middle bgColor=#3B6DC4 class=tdc1 colSpan=2 height=24><font color="#FFFFFF"> 
              国内身份证号码验证查询&nbsp; </font></TD>
          </TR>
          <TR bgColor=#eff1f3 class=tdc> 
            <FORM action="" method=post name="SfzIdform" onsubmit="return checkSfzId();">
              <TD align=middle width=160 noswap>请输入15或18位身份证号</TD>
              <TD align=middle><INPUT name="action" type="hidden" value="idcard"> 
                <INPUT name="SfzId" class=tdc id="SfzId" value="<%=request("SfzId")%>"> 
                &nbsp; 
                <INPUT class=bdtj name=B1 type=submit value="查 询"> </TD>
            </FORM>
          </TR>
        </TABLE>
        <BR>
<%
xian=request("SfzId")
lenx=len(xian)
if xian<>"" then
if not IsNumeric(left(xian,15)) and xian<>"" then
  response.write "<script>alert('请输入正确身份证号码!');window.history.back();</script>"
end if 

if lenx=15 or lenx=18 then 
    if lenx=15 then 
        yy="19"&mid(xian,7,2)
        mm=mid(xian,9,2)
        dd=mid(xian,11,2)
        aa=mid(xian,15,1)
    end if 
    if  lenx=18 then
        yy=mid(xian,7,4)
        mm=mid(xian,11,2)
        dd=mid(xian,13,2)
        aa=mid(xian,17,1)
    end if 
    if cint(mm)>12 or cint(dd)>31 then
      response.write "<script>alert('请输入正确的身份证号码!');window.history.back();</script>"
    end if  
   else
  response.write "<script>alert('请输入正确的身份证号码!');window.history.back();</script>"
end if 
set rs=server.createobject("adodb.recordset")
      sql="select * from Free_Sfz where bm="&left(xian,6)
      rs.open sql,strconn,3,3     
     if not rs.eof then
if aa mod 2=0 then 
  xb="女"
  else
  xb="男"
end if 
%>
        <TABLE width=520 border="1" style="border-collapse: collapse" bordercolor=#3366cc cellpadding="4">
          <TR> 
            <TD colspan=2 class=tdc1 align=center height=24 bgcolor=#3B6DC4><font color="#FFFFFF">++* 
              查询号码：<span class="style5"> <%=request("SfzId")%></span> *++</font></TD>
          </TR>
          <TR> 
            <TD colspan="2" align="center" noswap class=tdc2><TABLE width="70%">
                <TR>
                  <TD width="23%" align="left" class=tdc2>&nbsp;</TD> 
                  <TD width="77%" align="left" class=tdc2><font class="tdc3"> 性&nbsp;&nbsp;&nbsp;&nbsp;别：</font><%=xb%><BR>
                    <font class="tdc3">出生日期：<%=yy&"年"&mm&"月"&dd&"日"%></font><BR>
                    <font class="tdc3">发&nbsp;证&nbsp;地：</font><span>
                    <% = rs("dq")%>公安局
                    </span><br />
                    <font color="#FF0000">
                    <%
if lenx=18 then
if mid(xian,18,1)<>cstr(sfzjy(xian)) then
  response.write "提示：身份证校验位错误!"
  else
   response.write "结果：身份证号码校验为合法号码!" 
end if
  else
  response.write "新身份证："&left(xian,6)&"19"&right(xian,9)&cstr(sfzjy(xian))
end if
end if 
rs.close
set rs=nothing
end if 

FUNCTION sfzjy(num)

 if len(num)=15 then
cID = left(num,6)&"19"&right(num,9)
  elseif len(num)=17 or len(num)=18 then
cID = left(num,17)
  end if 

nSum=mid(cID,1,1) * 7
nSum=nsum+mid(cID,2,1) * 9 
nSum=nsum+mid(cID,3,1) * 10 
nSum=nsum+mid(cID,4,1) * 5 
nSum=nsum+mid(cID,5,1) * 8 
nSum=nsum+mid(cID,6,1) * 4
nSum=nsum+mid(cID,7,1) * 2
nSum=nsum+mid(cID,8,1) * 1
nSum=nsum+mid(cID,9,1) * 6
nSum=nsum+mid(cID,10,1) * 3
nSum=nsum+mid(cID,11,1) * 7
nSum=nsum+mid(cID,12,1) * 9
nSum=nsum+mid(cID,13,1) * 10
nSum=nsum+mid(cID,14,1) * 5
nSum=nsum+mid(cID,15,1) * 8
nSum=nsum+mid(cID,16,1) * 4
nSum=nsum+mid(cID,17,1) * 2
'*计算校验位
 check_number=12-nsum mod 11
 If check_number=10 then
     check_number="X"
  elseIf check_number=12 then
     check_number="1"
  elseif check_number=11 then
     check_number="0"
 End if
 sfzjy=check_number
End function
%>
                  </font><br>                  </TD>
                </TR>
              </TABLE>
            </TD>
          </TR>
        </TABLE>
      </div>
      
    </td>
  </tr>
  <tr>
    <td><!--#include virtual="/Inc/Foot.asp" --></td>
  </tr>
  <tr> </tr>
</table>
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkSfzId(){
	var sID = document.SfzIdform.SfzId.value
	if(!(/^\d{15}$|^\d{18}$|^\d{17}x$/.test(sID))){
		alert("请输入15位或18位身份证号");
		document.SfzIdform.SfzId.focus();
		return false;
	}
}
//-->
</SCRIPT>
</body>
</html>
