pass-protect

liunx

Guest
hi,
I'm having a problem when I try to make a login page, I hope one of you guys can help me out here :) ...

this is my login.asp:
<% @Language=VBScript%>
<% Option Explicit %>

<html>
<head><title>Login</title></head>
<body>
<%
If request("error")="1" then
response.write "Your username was not found in our database<br>"
End if
If request("error")="2" then
response.write "Your password did not match<br>"
End if
If request("error")="3" then
response.write "You must supply both a username and password<br>"
End if
%>
Please use your username and password to login to our secure area.<br>
<form method="post" action="verify.asp">
Username: <input type="text" name="111"><br>
Password: <input type="text" name="222"><br>
<input type="submit" name="submit" value="submit">

</form>
</body
</html>

this is my verify.asp:
<% @Language=VBScript %>
<% Option Explicit %>
<!--#include file="adovbs.inc"-->
<!--#include file="connection.asp"-->

<%
Dim username, password, objConn, foundIt, RS

username=trim(request.form("username"))
password=trim(request.form("password"))
If username = "" or password = "" then
response.redirect ("login.asp?error=3")
End If

Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "users", objConn

foundIt=False
Do Until RS.EOF OR foundIt
If (StrComp(RS("username"), username, vbTextCompare) = 0) Then
foundIt=True
Else
RS.MoveNext
End If
Loop
If Not foundIt Then
RS.Close
Set RS = Nothing
objConn.Close
Set objConn = Nothing
response.redirect("login.asp?error=1")
End If

If Not (StrComp(RS("password"), password, vbBinaryCompare) = 0) Then
RS.Close
Set RS = Nothing
objConn.Close
Set objConn = Nothing
Response.Redirect("login.asp?error=2")

Else Session("Valid") = Request("username")
Response.Redirect("welcome.asp")
End If
%>

and my welcome.asp:
<% @Language=VBScript %>
<% Option Explicit %>
<%
If Session("Valid") = "" Then
Response.redirect ("login.asp")
End If
%>

<html>
<head><title>Welcome</title></head>
<body>

Welcome <%=session("Valid")%>. You have successfully logged in.

</body>
</html>

Everytime I enter my username (111), password (222) and press 'Submit', it should connect me to verify.asp to check my inputs, and after that to welcome.asp.
The problem is that I get an error saying that verify.asp cannot be opened although it's definitely on my webspace. I can open <!-- m --><a class="postlink" href="http://...../verify.asp">http://...../verify.asp</a><!-- m --> so my browser gives me all the codes of it ...
The real link might help to understand things better, since my english isn't perfect :) : <!-- m --><a class="postlink" href="http://www.team-ireland.net/jan/jan%20test%20folder/login.asp">http://www.team-ireland.net/jan/jan%20t ... /login.asp</a><!-- m -->

What am I doing wrong?

Thx in Advance,
The goosethat is a result of you not having it on a windows machine. ASP is windows on apache you will need to use PHP or something
 
Back
Top