使用者帳號和密碼如何在登入時區分大小寫? |
尚未結案
|
kenny_yeh
一般會員 ![]() ![]() 發表:8 回覆:8 積分:3 註冊:2008-03-05 發送簡訊給我 |
各位先進: 請問一下在以下的Code中我如何使 使用者帳號和密碼如何在登入時區分大小寫? 是否有範例參考? 謝謝!! [code xml] <%@LANGUAGE="JAVASCRIPT" CODEPAGE="950"%> <!--#include file="Connections/LinkDB.asp" --> <% Session("UserName") = String(Request.Form("Name")) %> <% Session("UserPassword") = String(Request.Form("Password")) %> <% Session("UserDate") = Date() %> <% var Recordset1 = Server.CreateObject("ADODB.Recordset"); Recordset1.ActiveConnection = MM_LinkDB_STRING; Recordset1.Source = "SELECT * FROM UserAcount ORDER BY Name ASC"; Recordset1.CursorType = 0; Recordset1.CursorLocation = 2; AddNew.Delete與Update方法都不可以使用 --> Recordset1.LockType = 3; Recordset1.Open(); var Recordset1_numRows = 0; %> <% var Recordset2 = Server.CreateObject("ADODB.Recordset"); Recordset2.ActiveConnection = MM_LinkDB_STRING; Recordset2.Source = "SELECT * FROM Data ORDER BY 日期時間 ASC"; Recordset2.CursorType = 0; Recordset2.CursorLocation = 2; Recordset2.LockType = 1; Recordset2.Open(); var Recordset2_numRows = 0; %> <% var MM_LoginAction = Request.ServerVariables("URL"); if (Request.QueryString!="") MM_LoginAction = "?" Server.HTMLEncode(Request.QueryString); var MM_valUsername=String(Request.Form("Name")); var MM_valUserpassword=String(Request.Form("Password")); if (MM_valUsername != "undefined") { var MM_fldUserAuthorization=""; var MM_redirectLoginSuccess="/DataBase.asp"; var MM_redirectLoginFailed="/Login-Fail.asp"; var MM_flag="ADODB.Recordset"; var MM_rsUser = Server.CreateObject(MM_flag); MM_rsUser.ActiveConnection = MM_LinkDB_STRING; MM_rsUser.Source = "SELECT Name, Password"; if (MM_fldUserAuthorization != "") MM_rsUser.Source = "," MM_fldUserAuthorization; MM_rsUser.Source = " FROM UserAcount WHERE Name='" MM_valUsername.replace(/'/g, "''") "' AND Password='" MM_valUserpassword.replace(/'/g, "''") "'"; MM_rsUser.CursorType = 0; MM_rsUser.CursorLocation = 2; MM_rsUser.LockType = 3; MM_rsUser.Open(); if (!MM_rsUser.EOF || !MM_rsUser.BOF) { user Session("MM_Username") = MM_valUsername; //BrowSer輸入的值 if (MM_fldUserAuthorization != "") { Session("MM_UserAuthorization") = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value); } else { Session("MM_UserAuthorization") = ""; //沒有清空 }//if (MM_fldUserAuthorization != "") if (String(Request.QueryString("accessdenied")) != "undefined" && false) { MM_redirectLoginSuccess = Request.QueryString("accessdenied"); }//if (String(Request.QueryString("accessdenied")) MM_rsUser.Close(); Response.Redirect(MM_redirectLoginSuccess); }//if (!MM_rsUser.EOF || !MM_rsUser.BOF) MM_rsUser.Close(); Response.Redirect(MM_redirectLoginFailed); }//if (MM_valUsername != "undefined") %> <% function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p 1)].document; n=n.substring(0,p); } if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i for(i=0;!x&&d.layers&&i if(!x && d.getElementById) x=d.getElementById(n); return x; }//function MM_findObj(n, d) function MM_validateForm() { //v4.0 var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i =3) { test=args[i 2]; val=MM_findObj(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors ='- ' nm ' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors ='- ' nm ' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p 1); if (num }//if (test.indexOf('inRange') != -1) }//if (test.indexOf('isEmail')!=-1) }//if ((val=val.value)!="") else if (test.charAt(0) == 'R') errors = '- ' nm ' is required.\n'; }//if (val) }//for (i=0; i<(args.length-2); i =3) if (errors) alert('The following error(s) occurred:\n' errors); document.MM_returnValue = (errors == ''); }//function MM_validateForm() %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" c /> <title>補隙站網管子系統</title> </head> <body>
<form name="f1" id="f1">
系統時間:2024-09-12 11:07:07
聯絡我們 | Delphi K.Top討論版
|