Hi, I found this example from web.
Basiclly, it is simple log in system.
But somereason, it doesn't work.
index.asp
code:
<form method="post" action="login.asp">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit" value="LOGIN">
</form>
*login.asp
code:
<%@LANGUAGE = VBScript%>
<%
Dim username,password
username = Request.Form("username")
password = Request.Form("password")
If username = "" OR password = "" Then
Response.Redirect("index.asp")
Else
Dim cn,sql
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& Server.MapPath("database.mdb") &";Persist Security Info=False"
Set sql = cn.Execute("SELECT * FROM login WHERE username LIKE '" & username & "' AND password LIKE '" & password & "'")
If sql.EOF Then
Response.Redirect("index.asp")
Else
Session("username") = username
Response.Write("Benvenuto " & username & " nella tua area privata!")
End if
End if
%>
code:
*database
name: database.mdb
table: login
field1: username
field2: password
Error said:
No value given for one or more required parameters.
/hiroki/1_Login/login.asp, line 17
Do you have any idea what it means?
Line 17 was:
Set sql = cn.Execute("SELECT * FROM login WHERE username LIKE '" & username & "' AND password LIKE '" & password & "'")
It looks fine to me. Just executing sql command, isn't it?
Hmm...
Hiroki Kozai