Closed Thread Icon

Topic awaiting preservation: Simple log in system (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12936" title="Pages that link to Topic awaiting preservation: Simple log in system (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Simple log in system <span class="small">(Page 1 of 1)</span>\

 
Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 10-15-2003 10:44

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

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 10-15-2003 11:13

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 10-21-2003 04:22

Hi, thanks for your reply.
I changed like this:

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, rs, sql
[b] Set cn = Server.CreateObject("ADODB.Connection")
cn.Provider="Microsoft.Jet.OLEDB.4.0"
cn.Open(Server.Mappath("database.mdb"))
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open cn [/b]

Set sql = rs.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
%>



But still not working yet......


Hiroki Kozai

« BackwardsOnwards »

Show Forum Drop Down Menu