PHP Login System with Admin Features

This forum was created to talk about the PHP Login System with admin features created by jpmaster77 on evolt's website

    Either registration or login works, but not both.


    Number of posts : 2
    Registration date : 2010-05-25

    Either registration or login works, but not both.

    Post  Thoth on Tue May 25, 2010 1:50 pm

    So, I tried to add fields to the user table that could only be filled out while the user was logged in -- i.e., they don't appear in the registration form, but they do appear in useredit.

    This broke the registration form. It couldn't figure out how to add stuff to the user table. So, I did the sensible thing, and specified the fields to process during registration.
     $q = "INSERT INTO ".TBL_USERS." VALUES ('$username', '$password', '0', $ulevel, '$email', $time)";
    $q = "INSERT INTO ".TBL_USERS." (username, password, userid, userlevel, email, timestamp) VALUES ('$username', '$password', '0', $ulevel, '$email', $time)";

    So, then registration worked just fine, but no one could log in, because the form kept insisting that the usernames were not in the table -- including my admin username which had been there since install, long before I started screwing with the tables and forms. I changed back the registration query, and login worked again, but no one could register.

    I'm sure this is just me being a total dumbass, but can someone give me a clue?

    Number of posts : 220
    Age : 33
    Localisation : Long Island
    Registration date : 2007-05-14

    Re: Either registration or login works, but not both.

    Post  Linchpin311 on Fri Jun 18, 2010 8:18 pm

    Forgive me if this doesn't help at all but I'm answering this from my blackberry and its not correctly displaying all your code. These tips are just ideas from the top of my head. Hopefully they help.

    I have a feeling that you edited your database to accommodate for your new fields but in the registration function in session.php you may have forgot to add those fields to the query that adds a new row to the database. If this is the case this may lead to an unstable population of your database (forgive me if that sounds too technical...ha!). This could also cause your script to think the user names or passwords aren't correct when they really are.

    So check out the session.php page and the useredit.php page and make sure you are adding the same column names for both. If you don't want users to add certain information until users are registered then the column values for those fields should be left blank or NULL.

    Let me know if you are following me and if any of this helps.

    in the end, the universe tends to unfold as it should...

    Also note that it is your responsibility to die() if necessary.

      Current date/time is Sat Feb 16, 2019 9:13 pm