Need help with Login/Database

Reply

Join Date: Dec 2007
Posts: 2
Reputation: hoasabi is an unknown quantity at this point 
Solved Threads: 0
hoasabi hoasabi is offline Offline
Newbie Poster

Need help with Login/Database

 
0
  #1
Dec 3rd, 2007
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

login.asp

  1. <form name="form1" method="post" action="login_script.asp">
  2. <table width="100%" border="0" cellspacing="0" cellpadding="5">
  3. <tr>
  4. <td align="right">Username:</td>
  5. <td width="439"><input name="username" type="text" class="field" id="username"></td>
  6. </tr>
  7. <tr>
  8. <td align="right">Password:</td>
  9. <td><input name="Password" type="password" class="field" id="Password"></td>
  10. </tr>
  11. <tr>
  12. <td align="right">&nbsp;</td>
  13. <td><input type="submit" name="Submit" value="Submit">
  14. <input type="reset" name="Submit2" value="Reset"></td>
  15. </tr>
  16. </table>
  17. </form>

the login_script.asp code:

  1. <%
  2. usersname=request.form("Usersname")
  3. password=request.form("Password")
  4.  
  5. If Request.Form("username") = "" AND Request.Form("password") = "admin" Then
  6. Session("loggedIn") = True
  7. Response.Redirect "admin.asp"
  8.  
  9. end if
  10. %>

admin.asp

  1.  
  2. <!--#include virtual="connection.asp"-->
  3. <%
  4. if session("loggedin") <> "admin" then
  5. response.redirect "login_admin.asp"
  6. end if
  7. %>

the connection.asp

  1. <%
  2. 'Create an ADO connection object
  3. Set adoCon = Server.CreateObject("ADODB.Connection")
  4.  
  5. 'Set an active connection to the Connection object using a DSN-less connection
  6. adoCon.Mode = 3
  7. adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:\Inetpub\wwwroot\vmSight\database\tnt.mdb"
  8. %>
Last edited by hoasabi; Dec 3rd, 2007 at 5:16 pm.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 97
Reputation: VIeditorlover is an unknown quantity at this point 
Solved Threads: 5
VIeditorlover's Avatar
VIeditorlover VIeditorlover is offline Offline
Junior Poster in Training

Re: Need help with Login/Database

 
0
  #2
Dec 5th, 2007
Correct me if I am wrong, but response.redirect "login_admin.asp" can't work because there isn't such script!
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 48
Reputation: CertGuard is an unknown quantity at this point 
Solved Threads: 3
CertGuard's Avatar
CertGuard CertGuard is offline Offline
Light Poster

Re: Need help with Login/Database

 
0
  #3
Dec 5th, 2007
Correct, from the looks of it, that should be response.redirect "login_script.asp"
--
Robert Williams
CEO, Founder
CertGuard
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 2
Reputation: hoasabi is an unknown quantity at this point 
Solved Threads: 0
hoasabi hoasabi is offline Offline
Newbie Poster

Re: Need help with Login/Database

 
0
  #4
Dec 5th, 2007
Hi Thanks for the replied. I meant for the redirect to be response.redirect "login_admin_script.asp"

It was my typo.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 48
Reputation: CertGuard is an unknown quantity at this point 
Solved Threads: 3
CertGuard's Avatar
CertGuard CertGuard is offline Offline
Light Poster

Re: Need help with Login/Database

 
0
  #5
Dec 5th, 2007
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.
--
Robert Williams
CEO, Founder
CertGuard
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC