[問題] ASP新手請問帳號登入驗證問題
首先感謝此板給我很多資訊
也感謝在這幫助我的各位前輩
以下是我寫的程式
都是東參考西參考寫出來的~不過卻無法驗證~因為他會直接跳進登入成功
請各位大大幫我看出問題所在
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<%
username=Request("username")
password=Request("password")
Set CN=Server.CreateObject("ADODB.Connection")
CN.Open "Provider=SQLoledb;" & _
"Data Source=(local);" & _
"Uid=sa ; Pwd=1234;" & _
"Initial Catalog=testdb"
Set RS=Server.CreateObject("ADODB.Recordset")
SQLstr="Select * From TABLE2 Where username ='" + Request("username") + "'
And password ='" + Request("password") + "'"
Set RS=CN.Execute (SQLstr)
If RS.EOF=ture Then
SESSION ("Confirm")="FAIL"
%>
<SCRIPT LANGUAGE="javascript">
alert("帳號或密碼輸入錯誤,請重新輸入!")
location.href="index.html"
</script>
<%
Else
SESSION("Confirm")="OK"
%>
<SCRIPT LANGUAGE="javascript">
alert("登入成功!")
location.href="newtext4.asp"
</script>
<%
End If
%>
</body>
</html>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.59.1.60
→
09/01 01:04, , 1F
09/01 01:04, 1F
→
09/02 09:33, , 2F
09/02 09:33, 2F
噓
06/15 04:48, , 3F
06/15 04:48, 3F