databases, usernames and passwords..

This is a discussion on "databases, usernames and passwords.." within the Classic ASP section. This forum, and the thread "databases, usernames and passwords.. are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Aug 11th, 2004, 15:49
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
databases, usernames and passwords..

i'm very new to asp and this is probably very basic so bear with me!!!

i have a database holding usernames and passwords.

how do i check whether both a username and a passwords sent by "post" from a form are in the database in the same record? for example, a form with:

username:
password:

and then to check whether the username is there and whether the password matches it...

can anyone help? please?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Aug 11th, 2004, 17:00
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
It's actually an SQL Statement... Where you connect to Table Where User = "Username"

Then you check if recordSet("Password") = Request.Form("Password") . Can ya get it from there? Or do you still need help?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Aug 11th, 2004, 17:10
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
as I said, i'm ver new - can u still give me help please? much appreciated
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Aug 11th, 2004, 20:03
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,184
Blog Entries: 7
Thanks: 27
Thanked 21 Times in 18 Posts
I think you are looking for something like this:-
Code: Select all
strSQL = "SELECT * FROM tblLoginInfo " _
		& "WHERE username='" & Replace(Request.Form("login"), "'", "''") & "' " _
		& "AND password='" & Replace(Request.Form("password"), "'", "''") & "';"

	Set cnnLogin = Server.CreateObject("ADODB.Connection")
	cnnLogin.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
		& "DBQ=" & Server.MapPath("login.mdb"))

	Set rstLogin = cnnLogin.Execute(strSQL)

	If Not rstLogin.EOF Then
		%>
		


		All the Good Stuff We Want to Hide
		</p>
		<%
	Else
		%>
		


		<font size="4" face="arial,helvetica">
		Login Failed - Please verify username and password.
		</font>
		</p>
		


		Try Again
		</p>
		<%
		'Response.End
	End If
'taken from asp101 http://www.asp101.com/samples/login.asp
Hope this helps.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
databases, usernames, passwords

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL needed to compare usernames AdRock Databases 2 Sep 20th, 2007 11:10
passwords simon2233 PHP Forum 5 Apr 1st, 2007 23:19
md5 passwords scottw PHP Forum 2 Jan 14th, 2007 15:07


All times are GMT. The time now is 02:20.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42