User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 455,985 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,795 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 1273 | Replies: 4
Reply
Join Date: Dec 2007
Posts: 2
Reputation: hoasabi is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
hoasabi hoasabi is offline Offline
Newbie Poster

Need help with Login/Database

  #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

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

the login_script.asp code:

<%
usersname=request.form("Usersname")
password=request.form("Password")

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

end if
%>

admin.asp

 
<!--#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"
%>
Last edited by hoasabi : Dec 3rd, 2007 at 5:16 pm.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Posts: 47
Reputation: VIeditorlover is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
VIeditorlover's Avatar
VIeditorlover VIeditorlover is offline Offline
Light Poster

Re: Need help with Login/Database

  #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  
Join Date: Jul 2007
Posts: 48
Reputation: CertGuard is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 3
CertGuard's Avatar
CertGuard CertGuard is offline Offline
Light Poster

Re: Need help with Login/Database

  #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  
Join Date: Dec 2007
Posts: 2
Reputation: hoasabi is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
hoasabi hoasabi is offline Offline
Newbie Poster

Re: Need help with Login/Database

  #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  
Join Date: Jul 2007
Posts: 48
Reputation: CertGuard is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 3
CertGuard's Avatar
CertGuard CertGuard is offline Offline
Light Poster

Re: Need help with Login/Database

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 9:27 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC