Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
How do i add seperate usernames and passwords?
Old 12-22-2006, 02:51 PM How do i add seperate usernames and passwords?
Average Talker

Posts: 16
Name: brian
Trades: 0
How can i add more than 1 username and password to this code, is there a special delimeter (did i say that right "delimeter") to add between the seperate usernames and passwords. Do i need a whole new code? Here is the current code

<%
If (Request("USERNAME") <> "guest") Or (Request("PASSWORD") <> "arch") Then
Response.Redirect("index.asp?failedlogin=true&USER NAME=" & Request("USERNAME"))
End If
Response.Write Chr(13) ' prints out a carriage return as output in case the page is browsed to directly
%>

Can anyone help, thanks in advance
seooptimizer is offline
Reply With Quote
View Public Profile Visit seooptimizer's homepage!
 
 
Register now for full access!
Old 12-22-2006, 03:07 PM Re: How do i add seperate usernames and passwords?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Pull them from a database.

THE FOLLOWING IS UNCHECKED CODE. IF THERE ARE ERRORS, I DON'T ASSUME RESPONSIBILITY. (In other words, run it and be prepared to fix it somewhat.)
Code:
Dim Username, Password, Login_ID, SQL_Query
Username = Request.Form ("Username")
Password = Request.Form ("Password")
Login_ID = 0
SQL_Query = "Select Login_ID from Users where Username = '" & Username & "' and [Password] = '" & Password & "'"
' retrieve your database info here.
If Login_ID = 0 then
Response.Redirect("index.asp?failedlogin=true&USER NAME=" & Request("USERNAME")) 
end if
That oughta get you started.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 12-22-2006, 05:17 PM Re: How do i add seperate usernames and passwords?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Or here's one I prepared earlier without a database

http://www.candsdesign.co.uk/article...sp/site-logon/
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-22-2006, 05:53 PM Re: How do i add seperate usernames and passwords?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
My way is better though, just because I said so.

Seriously, there are pros and cons to each way. I personally prefer the database-driven approach because I find it easier to keep data (logins/passwords) separated from code, but Hirst's will work in situations where databases aren't allowed with a host.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to How do i add seperate usernames and passwords?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32727 seconds with 12 queries