2016-04-26 56 views
2

我有enroll.html頁面。該頁面的代碼如下:在後臺加載頁面不會在數據庫中插入數據

<HTML> 
<HEAD> 
<script src="https://code.jquery.com/jquery-2.2.3.min.js" integrity="sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=" crossorigin="anonymous"></script> 
<META http-equiv=Content-Language content=en-us> 
<META http-equiv=Content-Type content="text/html; charset=windows-1252"> 
<style TYPE="text/css"> 
    <!-- BODY    { font-family:arial,helvetica; margin-left:5; margin-top:0} 
      A     { color:#FF5500; text-decoration:underline} 
      A:hover,A:active { color:#0055FF; text-decoration:underline} 
     --> 
</style> 
<Script Language="JavaScript"> 
<!-- 
function inStrGrp(src,reg) 
{ 
    var regex=new RegExp("[" + reg + "]","i"); 
    return regex.test(src); 
} 

function check() 
{ 
    var uname=document.scan.elements[0].value 
    var bError=false 

    if (uname.length==0) 
    { 
     window.alert("Name is required.\n") 
     return false 
    } 
    if (uname.indexOf("\\")>=0) 
     bError=true 

    if (inStrGrp(uname,'/.:*?"<>| ')) 
     bError=true 

    if (bError) 
    { 
     window.alert('User name can not contain the following characters:\n \\/. :*?"<>|\n') 
     return false 
    } 
    else 
     return true 
} 
--> 
</Script> 

<title>Enroll New Fingerprint.</title> 
</HEAD> 
<BODY onload="document.scan.name.focus();"> 
<center> 
<table border="0" width="800"> 
    <tr> 
    <td width="100%" colspan="3"> 
     <p>&nbsp;</p> 
     <p><u><b>Online Demonstration</b></u></p> 
     <div align="center"> 
     <table border="1" width="100%" height="260"> 
     <tr> 
      <td width="20%" align="center" rowspan="2"> 
       <p>&nbsp;</p> 
       <p><font color="#0055FF">Enroll</font></p> 
       <p><a href="logon.asp">Logon</a></p> 
       <p>&nbsp;</p> 
      </td> 
      <td width="80%" height="30"> 
       <b><i>Enroll Finger</i></b> 
      </td> 
     </tr> 
     <tr> 
      <td width="80%"> 
     <p>Thanks for your registration. You can enroll two fingers for the name you registered.</p> 

     <form name="scan" method="POST" action="http://10.11.201.170/data/sultan/enroll.asp" onsubmit="return check()"> 
     <p>Please input your name: <input type="text" name="name" size="20">&nbsp;&nbsp;&nbsp;&nbsp;</p> 
     <p>If you want to enroll 2 fingers, please check the box. <input type="checkbox" name="chk2Finger" value="2">&nbsp;&nbsp;</p> 
     <p>&nbsp; 
     <input type="submit" value=" Enroll " id="buttonEnroll" name="btnEnroll"> 

     </form> 
<div id="result"></div> 
      </td> 
     </tr> 
     </table> 
     </div> 
     <p>&nbsp;</p> 
    </td> 
    </tr> 
    <tr> 
    <td width="100%" colspan="3"> 
     <p align="center"><small>Copyright © 2004 Futronic 
     Technology Company Limited. All Rights Reserved.</small></td> 
    </tr> 
</table> 

<script> 
     $("#buttonEnroll").on('click',function(e){ 
      e.preventDefault(); 
      $("#result").load("http://10.11.201.170/data/2/sysinfo1.asp"); 
      alert("Page loading completed"); 
     }); 
    </script> 
</center> 
</BODY> 
</HTML> 

我想加載sysinfo1.asp頁面時,當我按下注冊按鈕。該頁面中的代碼在數據庫中插入數據。該頁面的代碼如下:

<HTML> 
<HEAD> 
<META http-equiv=Content-Language content=en-us> 
<META http-equiv=Content-Type content="text/html; charset=windows-1252"> 
<style TYPE="text/css"> 
    <!-- BODY    { font-family:arial,helvetica; margin-left:5; margin-top:0} 
      A     { color:#FF5500; text-decoration:underline} 
      A:hover,A:active { color:#0055FF; text-decoration:underline} 
     --> 
</style> 
<Script Language="VBScript" Src="GetInfo.vbs"> 
</Script> 
<title>Enroll Fingerprint.</title> 
</HEAD> 
<BODY Onload="GetLearnModel()";> 
<center> 
<table border="0" width="800"> 
    <tr> 
    <td width="100%" colspan="3"> 
     <p>&nbsp;</p> 
     <p><u><b>Online Demonstration</b></u></p> 
     <div align="center"> 
     <table border="1" width="100%" height="260"> 
     <tr> 
      <td width="20%" align="center" rowspan="2"> 
       <p>&nbsp;</p> 
       <p><a href="enroll.asp">Enroll</a></p> 
       <p><a href="logon.asp">Logon</a></p> 
       <p>&nbsp;</p> 
      </td> 
      <td width="80%" height="30"> 
       <b><i>Enroll Finger</i></b> 
      </td> 
     </tr> 
     <tr> 
      <td width="80%"> 
     <Form name="scan" method="Post" action="famenroll2.asp?name=<%=Request("name")%>&check=<%=Request("check")%>&finger=<%=Request("finger")%>"> 
     <Input type="hidden" name="LearnModel" value=""> 
     <Input type="text" name="SlNo" value=""> 
     </Form> 
     <p>&nbsp;</p> 
     <p>&nbsp;</p> 
     <p>&nbsp;</p> 
     <p>&nbsp;</p> 
      <p><font size="5" color="#ff0000"><%=Request.Form("SlNo")%></font><font size="5">&nbsp;&nbsp;Enroll Successfully!</font></p> 
      </td> 
     </tr> 
     </table> 
     </div> 
     <p>&nbsp;</p> 
    </td> 
    </tr> 
    <tr> 
    <td width="100%" colspan="3"> 
     <p align="center"><small>Copyright © 2004 Futronic 
     Technology Company Limited. All Rights Reserved.</small></td> 
    </tr> 
</table> 
<% Dim Conn,strSQL,objExec,NumOfRecords,se_name,finger 
      cust_no=Request.QueryString("name") 
      Set Conn = Server.Createobject("ADODB.Connection") 
      Conn.Open "Driver={Oracle in XE};DBQ=xe;UID=biotpl;PWD=biotpl;"   

      'Query for the customer entry in FP_ENROLL Table 
      strSQL2 = "INSERT INTO TEST values(1,'OS')" 

       Set objExec = Conn.Execute(strSQL2) 

      'Query for the no of fingers to be taken for a customer in FP_FINGER_SETUP Table     
      'Set objExec = Conn.Execute("select FINGURE_NO NoF from BIOTPL.FP_FINGER_SETUP where USER_TYPE=" & Request.QueryString("cust_type")) 
      'NumOfFingers = objExec("NoF") 

      'Conn.Close() 
      Set objExec = Nothing 
      Set Conn = Nothing 
%> 
</center> 
</BODY> 
</HTML> 

但是數據沒有插入到數據庫中。爲什麼?有什麼問題嗎 ?

回答

2

從表單

action="http://10.11.201.170/data/sultan/enroll.asp" 

刪除以下行,然後它會工作,我猜。

相關問題