1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Applying a login system with an existing database

Discussion in 'PHP' started by scaiferw, Nov 14, 2018.

  1. #1
    I am trying to set up a login system for a volunteer portal for a charity for which I volunteer.
    SEMrush
    I have an existing database of people, and am trying to implement what appears to be a very good login system from Creating a User Login System with PHP and MySQL - Tutorial Republic. (https://www.tutorialrepublic.com/php-tutorial/php-mysql-login-system.php)

    The problem I'm having is that that set of scripts is designed for people signing up and adding themselves as new records in the database. In my case access is only for people who are already in the database, volunteers already known to the charity.

    I'd need to be able to generate the hashed (and presumably salted) password for a default password and apply it to the user record. Ideally I could require a password change at next login, alternatively just tell users to implement lost password procedure at first logon.

    I'd be very grateful for any assistance in adapting this system for my charity's needs.
     
    Last edited: Nov 14, 2018
    scaiferw, Nov 14, 2018 IP
    SEMrush
  2. SpacePhoenix

    SpacePhoenix Well-Known Member

    Messages:
    125
    Likes Received:
    12
    Best Answers:
    1
    Trophy Points:
    120
    #2
    What's the URL for the tutorial that you're using so that we can see if it uses any bad practices and/or outdated code/functions and if it does warn you about them
     
    SpacePhoenix, Nov 14, 2018 IP
  3. scaiferw

    scaiferw Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    I'd swear I'd included that. Are new members restricted from posted links perhaps? I'll try again - https://www.tutorialrepublic.com/php-tutorial/php-mysql-login-system.php
    Thanks,
    Rob
     
    scaiferw, Nov 15, 2018 IP
  4. AndresB

    AndresB Peon

    Messages:
    4
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    3
    #4
    Maybe I did not understand, but if the problem is that you do not want to allow users to register on the web and you already have them in the database, remove the option to register
    "<p> Do not have an account? <a href="register.php"> Sign up now </a>. </ p>"
    and don't create the registration page register.php (That's what I saw in the tutorial they do not create it either).
     
    AndresB, Jul 16, 2019 IP
  5. SpacePhoenix

    SpacePhoenix Well-Known Member

    Messages:
    125
    Likes Received:
    12
    Best Answers:
    1
    Trophy Points:
    120
    #5
    Just had a quick glance at that code and couldn't see any hashing of the password. Passwords should NEVER be stored in the database in plain text form.
     
    SpacePhoenix, Jul 17, 2019 IP
  6. JEET

    JEET Well-Known Member

    Messages:
    2,275
    Likes Received:
    118
    Best Answers:
    2
    Trophy Points:
    185
    #6
    Its a 9 month old thread. Why are you guys replying to it? The issue is probably already solved...
     
    JEET, Jul 22, 2019 IP