How to show a page if user enters right login and password

Discussion in 'PHP' started by kharearch, Dec 28, 2007.

  1. #1
    I want to show a page (html) to user if he enters right user and password. How can I do that ?
     
    kharearch, Dec 28, 2007 IP
  2. Dondon2d

    Dondon2d Peon

    Messages:
    3,193
    Likes Received:
    146
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use an if statement, so if the username and password are correct, you can redirect using javascript or the header function: header( 'Location: http://www.yoursite.com/new_page.html' );

    Don
     
    Dondon2d, Dec 28, 2007 IP
  3. DarkMindZ

    DarkMindZ Guest

    Messages:
    175
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    alright,

    I hope thats what you needed.
     
    DarkMindZ, Dec 28, 2007 IP
  4. wdstuff54

    wdstuff54 Well-Known Member

    Messages:
    639
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    110
    #4
    There is a good tutorial on this here.

    Enjoy.
     
    wdstuff54, Dec 28, 2007 IP
  5. tarponkeith

    tarponkeith Well-Known Member

    Messages:
    4,758
    Likes Received:
    279
    Best Answers:
    0
    Trophy Points:
    180
    #5
    You would need to give more specifics for someone to help you out... How many username and passwords will the input terms need to browse through?

    When dealing with logins, keep a couple more things in mind...
    1) use some form of encryption/hash to increase user's security
    2) don't use cookies, instead do sessions, as the user cannot (easily) manipulate the contents
    3) optional, keep track of how many times an invalid user/pass combo has been entered, and after too many tries, block the IP
     
    tarponkeith, Dec 28, 2007 IP
    buffalo likes this.