[PHP, MySQL] SLS - Simple Login System v1

Results 1 to 12 of 12
  1. #1
    Banned winterpartys is offline
    BannedRank
    Jan 2009 Join Date
    Australia, OLD.Location
    695Posts

    [PHP, MySQL] SLS - Simple Login System v1

    Hello,

    Made this simple script... more edits will be available soon with much more features such as AdminCP and user edit.

    This is 100% from scratch, it uses SESSION's not cookies since cookies can be Hijacked..
    And its also uses MySQL to store all its info. I have included a db

    Features:


    • Login
    • - Updates users coins/points everytime user logs in
    • - Starts $_SESSION
    • Profile
    • - Displays how much coins you have
    • - Says the logout link
    • Register
    • - Checks if user already exists.
    • - Checks if email already exists.
    • - Says error if a field is not filled in.
    • - SHA-1 hashes passwords
    • - Checks if email has a @ symbol
    • Logout
    • - Kills the $_SESSION


    Demo: SLS - Index
    Download: SLS v1.zip (3.78 KB)

    More edits will be released.


  2. #2
    Account Upgraded | Title Enabled! tycob is offline
    MemberRank
    Nov 2009 Join Date
    Installation 04Location
    263Posts

    Re: [PHP, MySQL] SLS - Simple Login System v1

    What are coins for? Making a shop for this system? Nice release XD!

  3. #3
    Banned winterpartys is offline
    BannedRank
    Jan 2009 Join Date
    Australia, OLD.Location
    695Posts

    Re: [PHP, MySQL] SLS - Simple Login System v1

    Quote Originally Posted by tycob View Post
    What are coins for? Making a shop for this system? Nice release XD!
    Idk rewards, got bored. More with coin handling will be done in v2.
    Anyway features for v2:

    Coming up for v2:

    • Banning system (100% works)
    • Admin CP (%50)
    • Moods and avatars
    • Profiles
    • Edit user details

  4. #4
    Account Upgraded | Title Enabled! tycob is offline
    MemberRank
    Nov 2009 Join Date
    Installation 04Location
    263Posts

    Re: [PHP, MySQL] SLS - Simple Login System v1

    Make sure you add in walls like facebook and a shoutbox XD!! Sorry bout that, just giving suggestions.

  5. #5
    Infraction Banned BGxApixen is offline
    MemberRank
    May 2009 Join Date
    939Posts

    Re: [PHP, MySQL] SLS - Simple Login System v1

    Looks nicely done.

    Good job.
    Last edited by BGxApixen; 26-11-10 at 08:53 AM.

  6. #6
    ex visor Aaron is offline
    MemberRank
    May 2007 Join Date
    MichiganLocation
    4,028Posts

    Re: [PHP, MySQL] SLS - Simple Login System v1

    In the registration form, add AJAX or the post variable in each input textbox, so if the registration fails, the user doesn't have to keep re-entering the data.

    AJAX would be better, imo. But whatever.

    EDIT: Somethings you may want to work on.
    It looks like you just ripped that login system from PHP Academy and called it your own, but that's beyond the point.

    Call forms by using
    PHP Code:
    if(isset($_POST['submit'])){} 
    And put all of the functions inside of that. Don't use mysql_num_rows, or whatever the hell you did.

    Also, ALWAYS use mysql_real_escape_string(); for all variables that are going in/out of your database. Mostly in, but just to be safe, do both.


    Everything seems okay, besides the login script, and the fact that you're not cleaning variables.
    Last edited by Aaron; 26-11-10 at 05:29 PM.

  7. #7
    Ginger by design. jMerliN is offline
    MemberRank
    Feb 2007 Join Date
    2,497Posts

    Re: [PHP, MySQL] SLS - Simple Login System v1

    Quote Originally Posted by Aaron View Post
    In the registration form, add AJAX or the post variable in each input textbox, so if the registration fails, the user doesn't have to keep re-entering the data.

    AJAX would be better, imo. But whatever.

    EDIT: Somethings you may want to work on.
    It looks like you just ripped that login system from PHP Academy and called it your own, but that's beyond the point.

    Call forms by using
    PHP Code:
    if(isset($_POST['submit'])){} 
    And put all of the functions inside of that. Don't use mysql_num_rows, or whatever the hell you did.

    Also, ALWAYS use mysql_real_escape_string(); for all variables that are going in/out of your database. Mostly in, but just to be safe, do both.


    Everything seems okay, besides the login script, and the fact that you're not cleaning variables.
    Not necessarily.

    Making Wrong Code Look Wrong - Joel on Software

  8. #8
    ex visor Aaron is offline
    MemberRank
    May 2007 Join Date
    MichiganLocation
    4,028Posts

    Re: [PHP, MySQL] SLS - Simple Login System v1

    Because I'm going to read that article.

  9. #9
    Ginger by design. jMerliN is offline
    MemberRank
    Feb 2007 Join Date
    2,497Posts

    Re: [PHP, MySQL] SLS - Simple Login System v1

    Quote Originally Posted by Aaron View Post
    Because I'm going to read that article.
    You should. Always sterilize is bad because it's difficult during a code review to spot bugs. If you always sterilize things before they go into a SQL query, you may be spitting them out on the page and think ah, it's not a SQL query so it's safe.. well hello XSS and your site has just been hacked. You may be using them to open a file on disk and the argument specifies path data, and now you've just handed them full read access to your disk (probably), but just securing the input before a query wouldn't make such an error blatantly obvious while writing code nor while reading it.

    The point of that article is precisely how you can achieve knowing when you need to sterilize inputs just by a simple naming convention (a take on Hungarian Notation), input from a trusted source is automatically fine, and input from a (potentially) untrusted source is obvious from the code itself, not from state, and so you can very easily spot potential security bugs.

    Reading won't hurt you. You might just learn something, too.

  10. #10
    Banned winterpartys is offline
    BannedRank
    Jan 2009 Join Date
    Australia, OLD.Location
    695Posts

    Re: [PHP, MySQL] SLS - Simple Login System v1

    Quote Originally Posted by Aaron View Post
    In the registration form, add AJAX or the post variable in each input textbox, so if the registration fails, the user doesn't have to keep re-entering the data.

    AJAX would be better, imo. But whatever.

    EDIT: Somethings you may want to work on.
    It looks like you just ripped that login system from PHP Academy and called it your own, but that's beyond the point.

    Call forms by using
    PHP Code:
    if(isset($_POST['submit'])){} 
    And put all of the functions inside of that. Don't use mysql_num_rows, or whatever the hell you did.

    Also, ALWAYS use mysql_real_escape_string(); for all variables that are going in/out of your database. Mostly in, but just to be safe, do both.


    Everything seems okay, besides the login script, and the fact that you're not cleaning variables.
    Yeah, It was coded very quick since it only took me about a day or even 5 hours.

    I mostly need to work on making my code neater and security also noob friendly.

    Btw, I find YouTube tuts hard to follow so I actually do research. :)

  11. #11
    Account Upgraded | Title Enabled! No0b is offline
    MemberRank
    Jul 2010 Join Date
    Michigan, USLocation
    1,426Posts

    Re: [PHP, MySQL] SLS - Simple Login System v1

    woah lol that is to weird, but I like it so thumbs up :D

  12. #12
    Banned winterpartys is offline
    BannedRank
    Jan 2009 Join Date
    Australia, OLD.Location
    695Posts

    Re: [PHP, MySQL] SLS - Simple Login System v1

    I've read Aaron's post and have secured my SLS system greatly. Now called Sophisticated Login System

    --

    Apart from that, I've added a style to my system and added: AdminCP (Secured and authenticates rank)
    Edit pass and email successfully also added 'What are coins'.

    And demo here:
    Winterpartys.ORG



    I'll release soon, just I'll finish PM system/start it and finish AdminCP

    ---

    Also fixed the IP ban and user ban and I know this is very simple but It never logged the ip so now it does :)
    Last edited by winterpartys; 29-11-10 at 12:18 AM.



Advertisement