Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    MLG
    MLG is offline
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conditional Login with no database

    Hello.

    I'm trying to create a very, very simple site for internal use. Basically, I need to have two predetermined users with passwords (ie. "user1" "password1" and "user2" "password2") who would see almost the same content, but user1 would see an additional navigation button or paragraph.

    I know this isn't the most secure way, but we aren't too concerned about that for this content. I'd like to be able to do it without creating a database or building out two nearly identical sites, but I'm completely new to asp and at a loss as to how to make this happen. Is this possible?

    Can anyone help me out? Or point me in the right direction of resources to make this happen that are written in "dummies" language because so much of what I've read is still over my head? Or even give me better terminology as to what I'm trying to do to help refine my searching?

    Any help would be greatly appreciated.
    Thanks!

  • #2
    Regular Coder
    Join Date
    May 2008
    Location
    Oxford, UK
    Posts
    422
    Thanks
    14
    Thanked 27 Times in 27 Posts
    Code:
    <%
    
    dim user1
    dim user1password
    
    user1 = "theUserName1"
    user1password = "thePassword1"
    
    dim user2
    dim user2password
    
    user2 = "theUserName2"
    user2Password = "thePassword2"
    
    if (request.form("user") = user1) and (request.form("password") = user1Password) then
    response.write("You are logged in as user 1")
    
    elseif (request.form("user") = user2) and (request.form("password") = user2Password) then
    response.write("You are logged in as user 2")
    
    else
    response.write("piss off")
    end if
    
    %>
    I'm drunk right now but that should sort you out. Replace the response.write with whatever you want!
    Last edited by brazenskies; 12-19-2008 at 01:23 AM.

  • #3
    Regular Coder
    Join Date
    May 2008
    Location
    Oxford, UK
    Posts
    422
    Thanks
    14
    Thanked 27 Times in 27 Posts
    don't know why I bother

  • #4
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    :d:d:d:d

  • #5
    MLG
    MLG is offline
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Brazenskies. Sorry to not respond. I got sick and haven't been functioning since my post. Looks like this will get me started off in a much better direction than where I was. I appreciate your help.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •