1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How can i create login form in PHP?

Discussion in 'PHP & Perl' started by hirephp, Apr 25, 2012.

Tags:
  1. hirephp

    hirephp Newbie

    Joined:
    Jun 9, 2011
    Messages:
    6
    Likes Received:
    0
    Home Page:
    How can i create login form in PHP?
     
    Last edited: Apr 25, 2012
  2. roster67

    roster67 Registered Member

    Joined:
    Mar 27, 2012
    Messages:
    69
    Likes Received:
    10
    With notepad++ obviously...
     
  3. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,148
  4. RuiGomes

    RuiGomes BANNED BANNED

    Joined:
    Jun 12, 2010
    Messages:
    700
    Likes Received:
    238
    This must be one of the PHP subjects with the most tutorials out there. If you want someone to do your work, then open up a WTB thread and pay. Otherwise, learn to use Google.
     
  5. upl8t

    upl8t Regular Member

    Joined:
    Apr 9, 2008
    Messages:
    475
    Likes Received:
    84
    Location:
    New Scotland
    There's lots of open source login scripts available for php. Search Google and look for something that has been tested and secured. Much safer if you've never done this before. And then study the scripts to see what they're doing.
     
  6. thejake

    thejake Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 13, 2009
    Messages:
    685
    Likes Received:
    828
  7. markjeff

    markjeff Newbie

    Joined:
    Apr 26, 2012
    Messages:
    1
    Likes Received:
    0
    Home Page:
    Get an SSL certificate. Once you have HTTPS working on your server (work with your hosting company to get it working), you can use code similar to the following to force an HTTPS connection in PHP. .htaccess is another option, mentioned elsewhere.
     
  8. roster67

    roster67 Registered Member

    Joined:
    Mar 27, 2012
    Messages:
    69
    Likes Received:
    10
    Nice one!
     
  9. markhenry121

    markhenry121 Elite Member

    Joined:
    Oct 14, 2011
    Messages:
    2,149
    Likes Received:
    239
    You can't make form directly in PHP but it provides dynamic features in web pages. Form is made on HTML language and PHP basically meant for server side working.
     
  10. bingus71

    bingus71 Newbie

    Joined:
    Jul 29, 2011
    Messages:
    2
    Likes Received:
    0
    Create database table in mysql with username and password held
    create login form
    post to a processing page (on that page access database and compare login variables)
    if variables don't match redirect to log out page and destroy session
    if login variables match create session and add variables to session
    run security at the top of each page to check if the user is good if not send to session destroy page
    use session to keep people out of pages with security script

    thats just what I do in a nut shell but I add a few other things here and there
    Brenig at Univelocity
     
  11. istart

    istart Junior Member

    Joined:
    Oct 10, 2011
    Messages:
    116
    Likes Received:
    26
    Occupation:
    Web developer - apps and db.
    Location:
    Canada
    What does https have to do worth logging in?
     
  12. Vaspar

    Vaspar Jr. VIP Jr. VIP

    Joined:
    Sep 9, 2011
    Messages:
    528
    Likes Received:
    89
    The first file we need to create is "main_login.php" which is a login form.