[INFORMATICA] - Asp
Posted by superfabius on 19-08-2003 10:23
Ho fatto questa semplice pagina asp di login ma mi indirizza sempre verso la pagina di errore.

<HTML>
<BODY bgcolor=#000060>
<FONT face=arial color=blue>
<P>Aristotle Middle School: Login</P>
</FONT>
<FORM Name=Myform Method="Post" Action="/11asp02.asp">
<FONT face=arial color=red size=3>
<P>LoginID: <input type=text name=LoginID></P>
<P>Password: <input type=password name=pwd></P>
</FONT>
<P>
<INPUT type="submit" value="Send" name=submit>
</P>
</FORM>
</BODY>
</HTML>

questa è la pagina a cui invio i dati...

<HTML>
<BODY bgcolor=#000060>
<%
Function Login(LoginID, Password)
Dim cn
Dim rs
Dim strSql
Dim strCn
Set cn=CreateObject("ADODB.Connection")
Set rs=CreateObject("ADODB.Recordset")
strSql="SELECT * FROM tblLog WHERE LoginName= '" & LoginID & "'"
On Error Resume Next
str="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="&server.MapPath("/mdb-database/DBSource.mdb")
cn.Open str
If Err Then Exit Function
rs.Open strSql, cn
If Err Then Exit Function
If rs("pwd")=Password Then
Login=True
Else
Login=False
End If
rs.Close
cn.Close
Exit Function
End Function
If Login(Request.Form("LoginID"),Request.Form("pwd")) Then
Response.Redirect("benvenuto.html")
Else
Response.Redirect("err.html")
End If
%>
</BODY>
</HTML>

qualcuno mi sa dire che errore c'è?
cià
Powered by: vbHome (lite) v3.8 and vBulletin v2.3.1
Copyright © 2000 - 2002 Jelsoft Enterprises Limited