当前位置: 代码迷 >> ASP >> ,ASP脚本语言没起作用
  详细解决方案

,ASP脚本语言没起作用

热度:379   发布时间:2012-04-30 22:33:26.0
求助,ASP脚本语言没起作用
检验身份证的脚本没起来,不知道原因出在哪里了?各位帮我看看,谢谢了
HTML code



<%if Request("post")="go" then%>

<SCRIPT LANGUAGE="JavaScript">
<!--
function checkIdcard(idcard){
    var Errors=new Array(
    "0",
    );
    var idcard,Y,JYM;
    var S,M;
    var idcard_array = new Array();
    idcard_array = idcard.split("");
    //地区检验
    if(area[parseInt(idcard.substr(0,2))]==null) return Errors[4];
    //身份号码位数及格式检验

    switch(idcard.length){
    case 15:
        if ( (parseInt(idcard.substr(6,2))+1900) % 4 == 0 || ((parseInt(idcard.substr(6,2))+1900) % 100 == 0 && (parseInt(idcard.substr(6,2))+1900) % 4 == 0 )){
            ereg=/^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}$/;//测试出生日期的合法性
        } else {
            ereg=/^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}$/;//测试出生日期的合法性
        }
        
        if(ereg.test(idcard)){
            return Errors[0];
        }
        else {
            return Errors[2];
        }    
        break;
    case 18:
        if ( parseInt(idcard.substr(6,4)) % 4 == 0 || (parseInt(idcard.substr(6,4)) % 100 == 0 && parseInt(idcard.substr(6,4))%4 == 0 )){
        ereg=/^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}[0-9Xx]$/;//闰年出生日期的合法性正则表达式
        } else {
        ereg=/^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}[0-9Xx]$/;//平年出生日期的合法性正则表达式
        }
        if(ereg.test(idcard)){
            S = (parseInt(idcard_array[0]) + parseInt(idcard_array[10])) * 7
        + (parseInt(idcard_array[1]) + parseInt(idcard_array[11])) * 9
        + (parseInt(idcard_array[2]) + parseInt(idcard_array[12])) * 10
        + (parseInt(idcard_array[3]) + parseInt(idcard_array[13])) * 5
        + (parseInt(idcard_array[4]) + parseInt(idcard_array[14])) * 8
        + (parseInt(idcard_array[5]) + parseInt(idcard_array[15])) * 4
        + (parseInt(idcard_array[6]) + parseInt(idcard_array[16])) * 2
        + parseInt(idcard_array[7]) * 1 
        + parseInt(idcard_array[8]) * 6
        + parseInt(idcard_array[9]) * 3 ;
        else return Errors[2];
        break;
        default:
        return Errors[1];
        break;
    }

}

//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function check(){
    var tempobj = null;
    temp = document.getElementById("name").value;
    if (temp.length == 0) {
        alert("请输入姓名!");
        document.getElementById("name").focus();
        return false;
    }
    temp = document.getElementById("tel").value;
    if (temp.length == 0) {
        alert("请输入联系电话!");
        document.getElementById("tel").focus();
        return false;
    }
    temp = document.getElementById("idnum").value;
    if (temp == "" ) {
        alert("请输入您正确的身份证号码!");
        document.getElementById("idnum").focus();
        return false;
    }
    else {
        if (checkIdcard(temp)!="0"){
        alert("请输入您正确的身份证号码!");
        return false;
        }
    }
    
    formlogin.submit()
}

//-->
</SCRIPT>


<p align="center"><b><font color="#FF0000">请仔细检查一下你提交的信息,如果确定无误</font></a></b><br><b><font color="#FF0000">请点击这里(</font><a href="admin.post.asp?post=ok&id=<%=Request("id")%>">完成提交</a><font color="#FF0000">)&nbsp; 
如果发现错误请(</font><a href=# onClick='history.go(-1)' >返回</a><font color="#FF0000">)</font></b><p>
<%    



Session("ypgw") = HTMLEncode(Request("ypgw"))
Session("name") = HTMLEncode(Request("name"))
Session("sex") = HTMLEncode(Request("sex"))
Session("date") = HTMLEncode(Request("date"))
Session("idnum") = HTMLEncode(Request("idnum"))
Session("zzmm") = HTMLEncode(Request("zzmm"))
Session("graschool") = HTMLEncode(Request("graschool"))
Session("gradate") = HTMLEncode(Request("gradate"))
Session("gzdw") = HTMLEncode(Request("gzdw"))
Session("elevel") = HTMLEncode(Request("elevel"))
Session("itlevel") = HTMLEncode(Request("itlevel"))
Session("height") = HTMLEncode(Request("height"))
Session("weight") = HTMLEncode(Request("weight"))
Session("hjqk") = HTMLEncode(Request("hjqk"))
Session("spec") = HTMLEncode(Request("spec"))
Session("sxdw") = HTMLEncode(Request("sxdw"))
Session("tel") = HTMLEncode(Request("tel"))


Response.End
End if

%>

<%
if Request("post")="ok" and Request("id")="" then
set rsa = Server.CreateObject("adodb.recordset")
rsa.open "select top 1 id from zzzp order by id desc" , conn, 1, 3
'Session("id") = rsa("id") + 1
rsa.close
rsa.open "select * from zzzp ",conn,1,3
rsa.AddNew


rsa("ypgw")=Session("ypgw") 
rsa("name")=Session("name") 
rsa("sex")=Session("sex") 
rsa("date")=Session("date") 
rsa("idnum")=Session("idnum") 
rsa("zzmm")=Session("zzmm") 
rsa("graschool")=Session("graschool") 
rsa("gradate")=Session("gradate") 
rsa("gzdw")=Session("gzdw") 
rsa("elevel")=Session("elevel") 
rsa("itlevel")=Session("itlevel")
rsa("height")=Session("height")
rsa("weight")=Session("weight") 
rsa("hjqk")=Session("hjqk") 
rsa("spec")=Session("spec")
rsa("sxdw")=Session("sxdw") 
rsa("tel")=Session("tel")

rsa.update
Response.Write("提交成功! <a href='../../../index.aspx'>点击返回</a>")
Response.End
End if
%>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>信息录入</title>
</head>
<style>
</style>

<body>


<form id="formlogin" name="formlogin" method="POST" action="?post=go&id=<%=Request("id")%>">

  <center>
  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: 4px double #808080; padding: 3" bordercolor="#111111" width="750">

        <tr>
          <td width="100%" height="30" valign="bottom">
            <p align="center"><font size="5"><b></b></font>            </td>
        </tr>
        <tr>
          <td width="100%"><hr noshade color="#000000" size="1"></td>
        </tr>
        <tr>
          <td width="100%" height="30">岗位:
            <input type="text" name="ypgw" size="20" style="border: 1px solid #808080; padding: 0" value=""></td>
        </tr>
        <tr>
          <td height="30">姓名
            :
            <input type="text" name="name" size="15" style="border: 1px solid #808080; padding: 0" value="">
性别
            :
<input type="text" name="sex" size="7" style="border: 1px solid #808080; padding: 0" value="">
身高:
<input type="text" name="height" size="8" style="border: 1px solid #808080; padding: 0" value="">
cm 体重:
<input type="text" name="weight" size="8" style="border: 1px solid #808080; padding: 0" value="">
Kg </td>
        </tr>
        <tr>
          <td width="100%" height="30">出生年月(20110101)
            :
            <input type="text" name="date" size="16" style="border: 1px solid #808080; padding: 0" value="">
            身份证号码:
            <input type="text" name="idnum" size="30" style="border: 1px solid #808080; padding: 0" value="">
            政治面貌:
            <input type="text" name="zzmm" size="18" style="border: 1px solid #808080; padding: 0" value=""></td>
        </tr>
        
        <tr>
          <td width="100%" height="30">毕业学校(学校全称):
            <input type="text" name="graschool" size="30" style="border: 1px solid #808080; padding: 0" value="">
            毕业时间(20110101)
            :
            <input type="text" name="gradate" size="20" style="border: 1px solid #808080; padding: 0" value="">          </td>
        </tr>
        <tr>
          <td height="30">原工作单位: 
            <input type="text" name="gzdw" size="25" style="border: 1px solid #808080; padding: 0" value="">
            (应届毕业生不填) 外语水平:
            <input type="text" name="elevel" size="20" style="border: 1px solid #808080; padding: 0">
            计算机水平:
            <input type="text" name="itlevel" size="15" style="border: 1px solid #808080; padding: 0" value=""></td>
        </tr>

        <tr>
          <td height="30">实习单位:<input type="text" name="sxdw" size="40" style="border: 1px solid #808080; padding: 0" value="">
          手机号码:<input type="text" name="tel" size="30" style="border: 1px solid #808080; padding: 0" value="">
          (外地手机号前请加0)</td>
        </tr>
        <tr>
          <td height="30">特长:
            <input type="text" name="spec" size="80" style="border: 1px solid #808080; padding: 0" value=""></td>
        </tr>
        <tr>

        </tr>
        <tr>
          <td height="30">获奖情况(最多五项):</td>
        </tr>
        <tr>
          <td width="100%">
          <p>
<textarea name="hjqk" rows="10" cols="98" class="Content" style="border: 1px solid #808080; padding: 0"></textarea></td>
        </tr>
        <tr>
          <td height="30">&nbsp;</td>
        </tr>
        <tr>
        <tr>
          <td width="100%" height="30">&nbsp;</td>
        </tr>
        <tr>
          <td width="100%" height="30">
          <p align="center">
          <input type="submit" name="Submit" value=" 提交 " class=button style="border: 1px solid #808080; padding: 0; width:60; height:20" onsubmit=" return check()">
          <input name="add" type="hidden" id="add" value="ok" />
          <input name="Submit2" type="reset" value=" 重填 " class=button style="border: 1px solid #808080; padding: 0; width:60; height:20" />
         </td>
        </tr>
      </table>

    </td>
    </tr>
  </table>

  </center>
  </from>