PHP Login System Reloaded

Update: There’s a new version of this Login Script. Here’s a PHP Login System, based on the one developed by jpmaster77: PHP Login System with Admin Features Focusing only on the core functionalities and aimed to improve certain parts of the code, I took out some functionalities and added some others: Removed: Admin features Active […]

Update: There’s a new version of this Login Script.

Here’s a PHP Login System, based on the one developed by jpmaster77: PHP Login System with Admin Features
Focusing only on the core functionalities and aimed to improve certain parts of the code, I took out some functionalities and added some others:

Removed:

  • Admin features
  • Active guests, active users, banned users
  • Global variables
  • Links to other pages after the login

All these can be easily reintegrated if you want. I focused on the login and registration part, leaving out the content “inside”.

Added:

  • PHP 5 instead of PHP 4
  • mysqli extension
  • Send registration confirmation link to the email address
  • Reset password feature without sending password to the email. Instead a link is sent to reset the password
  • UTF8 support
  • InnoDB transactions for database operations
  • Registration and form validations made with AJAX
  • jQuery
  • Captcha image in registration form to avoid spam

Here are the most important settings for the installation of the login system.
Set database access in constants.php:

define("DB_SERVER", "localhost");	//type mysql server url
define("DB_USER", "XXXXXXX");		//type mysql user
define("DB_PASS", "XXXXXXX");		//type mysql password
define("DB_NAME", "XXXXXXX");		//type mysql database name

Further, you have to set the right location of the following files for the mail sending functions:

define("RESETPASSWORDLINK","http://www.tympanus.net/loginsystem/resetpassword.php");
define("CONFIRMACCOUNTLINK","http://www.tympanus.net/loginsystem/php/confirm.php");

The only table that you have to create in your MySQL database is the following:

CREATE TABLE users(
pk_user int unsigned not null auto_increment,
email 	varchar(120) not null,
flname varchar(100) not null,
password varchar(64) not null,
usr_signup_date timestamp not null default CURRENT_TIMESTAMP,
usr_userid varchar(32),
# for the account confirmation:
usr_confirm_hash varchar(255) not null,
# after confirming its set to 1:
usr_is_confirmed tinyint(1) not null default 0,
# when the user resets password (forgot password):
usr_resetpassword_hash varchar(255) not null,
unique index(email),
primary key(pk_user)
)type=innodb DEFAULT CHARACTER SET utf8	COLLATE utf8_general_ci;

I will soon post a new version, as I am currently improving some points.

See a demo here: PHP Login System Demo

You can download the source code here: PHP Login System ZIP

Previous:
Next:

Tagged with:

Chadking is an absolute geek that rarely leaves the comfort of his 3-screen desk. He is a self taught programmer and is addicted to all possible legal drugs.

View all contributions by

Website: http://tympanus.net/codrops/author/chadking/

Related Articles

Feedback 71

Comments are closed.
  1. 1

    hi

    I try to use this script (only the php actions) on my site.

    root->-index.html
    ->/login (your script)

    I can put the forms in my site, but when i press login, he redirect to the register page, and I cant login.
    is it also possible to register without mail, but with a master password? (so I need to give a pass before they can register?)
    thanks, any info is welkom

  2. 2

    HI! The script is incredible.
    The only problem i have is to make captcha part working at the registration form!
    Is anybody have any idea what might be wrong? I would kindly appreciate any help!

  3. 3

    Hello. I just started configure this script pack, hope it will work perfect!
    @ Elena, you should define your problem and i’m sure they will help you out:)

    Free unlimited host offer active at dawnforged.com be quick!

  4. 4

    guys, why not using the updated version of this script? The captcha there is much better!
    cheers

  5. 5

    who can help me to put his login script into my website?:(it.s really good,but i don.t now how i can install him!if anibody can help me,add me to yahoo. dddimoncic ths a lot!

  6. 7

    What i actualy mean is that, submited values that came from form textbox and so on, I want to use to get submited forms data to email address without having a database.

    I need guild on it pls

    Expecting…

  7. 8

    hello,
    seem to get a jquery problem, when hitting register button, the green ajax status bar keeps flashing infinitely although the registration data is being recorded to sql tables correctly, but the green status bar just does not disappear and keeps flashing…hope that’s not too confusing…i wonder what could be the cause of the problem. thanks!

  8. 9

    I have created another field in the users database called ‘userid1′ and set it to autoincrument.

    I would like to make this available to when the session starts so that I can track my users.

    how can I do that so it is available for me to see like their user name.

    cheers and thanks for your great work

  9. 10

    Helo. I have a problem. In the registration and “password forget” if i click to the “Register” or “Send” button, nothing happen. Only the ajax loader image plays again and again. Not show an error or go a next page. Why. Here my registration button part:

    Back
    Registration

    Please help :)

  10. 13

    Hey Chad,
    thanks for the great login system. I installed everything correctly (I’m pretty sure) and I get “an error ocurred bla bla we should put a message for this”. This occurred right after I pressed ‘Register”. I checked the code and found the error trap in ‘register.php’, but in looking at the ‘else if’ statement, can’t make sense of the ‘data.result == “-2″. Any help please? Thanks again

  11. 14

    Everybody must know that the submit button can not work on testing server that is not connected to the internet. And if a user is manually entered into the table the sha1 in the core.php where the _login() function is called should be removed if not you will be having “invalid password” message.

  12. 15

    Hello! Tell how to change please the coding of outgoing letters with utf-8 on windows-1251?

Comments are closed.