作者kokokokoko (22)
看板Web_Design
標題[問題] ASP新手請問帳號登入驗證問題
時間Mon Aug 31 12:02:55 2009
首先感謝此板給我很多資訊
也感謝在這幫助我的各位前輩
以下是我寫的程式
都是東參考西參考寫出來的~不過卻無法驗證~因為他會直接跳進登入成功
請各位大大幫我看出問題所在
<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
→ terrybob:Q___Q 幫無可幫,問題太多了…加油!好嗎 09/01 01:04
→ kokokokoko:感謝~我自己解決了 09/02 09:33
噓 love2010:....這三小 06/15 04:48