Hi, I need some help with ASP. I''m only familiar with the language but now I have to do project.

I have 3 pages: login.asp, login_script.asp and admin.asp and i'm using access database

When the user logs into the login.asp page, it checks the database to see if that username and password exist, if so, the forms sends it to the login_script.asp and redirect to admin.asp.

Well my script seems to stalled at login_script.asp and refuses to redirect to admin.asp. Like it never gets pass that point. Can someone please help me? Thanks for your time!

database: tnt.mdb, table: user
Fields: loginType, usersname, password, loginType, Company, status


<form name="form1" method="post" action="login_script.asp">
           <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                 <td align="right">Username:</td>
                 <td width="439"><input name="username" type="text" class="field" id="username"></td>
                 <td align="right">Password:</td>
                 <td><input name="Password" type="password" class="field" id="Password"></td>
                 <td align="right">&nbsp;</td>
                 <td><input type="submit" name="Submit" value="Submit">
                 <input type="reset" name="Submit2" value="Reset"></td>

the login_script.asp code:


If Request.Form("username") = "" AND Request.Form("password") = "admin" Then
Session("loggedIn") = True
Response.Redirect "admin.asp"

end if


<!--#include virtual="connection.asp"-->
if session("loggedin") <> "admin" then
	 response.redirect "login_admin.asp"
end if

the connection.asp

'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a DSN-less connection
adoCon.Mode = 3
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:\Inetpub\wwwroot\vmSight\database\tnt.mdb"
10 Years
Discussion Span
Last Post by CertGuard

Correct me if I am wrong, but response.redirect "login_admin.asp" can't work because there isn't such script!


Hi Thanks for the replied. I meant for the redirect to be response.redirect "login_admin_script.asp"

It was my typo. :(


So, does it work now?

The information you just provided still doesn't match what you originally posted and doesn't look like it will work.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.