SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 19th, 2000, 10:27 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
asp/access database username and password authentication

<i><b>Originally posted by : william (wmatthers@yahoo.com)</b></i><br />I am having a problem with creating a script that verifies whether or not a user has an account in a database table. If so he or she gets access; if not they are redirected to the home page. Below are my problem.<br /><br />1. The user is supposed to create an account with the username and password of thier choice. The data goes into a database table.<br /><br />2. Then they are directed to a log in page.<br /><br />3. Next, they log in with the created username and password to access a secure page.<br /><br />4. If they have an account they get access to the page, but if they do not have an account they get redirected back to the home page.<br /><br />The problem I am having is the actual script that queries the database table and directs them to the secure page and redirects them if they do not have an account.<br /><br />Can anyone help? I am slowly getting the hang of asp, but am very confused as I am new to programming with asp.<br /><br />Thanks for all of your help.

Reply With Quote
  #2  
Old December 19th, 2000, 11:51 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Lee Campbell (Lee_c@ihug.co.nz)</b></i><br />This might kick start your efforts here. I do the same thing in one of my websites that I am developing now<br /><br />First I get the user name and password from the previous pages form<br /><br /><%<br />Name=Request.Form("ID")<br />Assigned=Request.Form("Password")<br />%><br /> Next I declear the SQL statement that is going to check the DB (Database) if there is such a user<br /><br /><%<br />SQLUSER="SELECT userID, password FROM ADMIN WHERE userID = '" & Name & "' AND password = '" & Assigned & "'"<br />%><br /><br />Next I open the connection to My DB<br /><br /><%<br />set connresult = server.createobject("ADODB.Connection")<br />connresult.open "DATABASENAME"<br />%><br /><br /> And now make the query to the DB<br /><br /><%<br />set user=connresult.execute(SQLUSER)<br />%><br /><br />Now To see if the user exists check if 'user' is at the end of its records or 'End Of File' (eof)<br />(We know it is at the start of the records because we haven't told it to <br />move to the next one yet, but if it is at the end of the records as well then<br />there must be no records!)<br /><br /><% If user.eof then<br /> response.redirect "Homepage.html"<br />else<br /> session("access")=True<br /> response.rediect "destinationpage.asp"<br />end if %><br /><br />After the else statement I have set a Session Variable "access" (can be named <br />anything) to true. Session Variables hold their values across pages so at the <br />destination page (here called destinationpage.asp) jsut check if sesion("access")=true.<br />If it doesn't use <br /><% response.redirect " " %><br />to redirect the user to an error page or back to the homepage.<br /><br />------------<br />william at 12/19/2000 8:27:47 AM<br /><br />I am having a problem with creating a script that verifies whether or not a user has an account in a database table. If so he or she gets access; if not they are redirected to the home page. Below are my problem.<br /><br />1. The user is supposed to create an account with the username and password of thier choice. The data goes into a database table.<br /><br />2. Then they are directed to a log in page.<br /><br />3. Next, they log in with the created username and password to access a secure page.<br /><br />4. If they have an account they get access to the page, but if they do not have an account they get redirected back to the home page.<br /><br />The problem I am having is the actual script that queries the database table and directs them to the secure page and redirects them if they do not have an account.<br /><br />Can anyone help? I am slowly getting the hang of asp, but am very confused as I am new to programming with asp.<br /><br />Thanks for all of your help.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > asp/access database username and password authentication


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway