PHP Login System Reloaded v1.1

Here’s an updated version of the PHP Login System. You can check the old version here. The following was added: 1. Registration fields: email confirmation password confirmation country recaptcha Email confirmation and password confirmation are configurable fields. By default they are shown, but if you wish to remove one or both of them you have […]

From our sponsor: Supercharge your marketing across design, automations, analytics, and more, using our marketing smarts.


PHP Login System

Here’s an updated version of the PHP Login System. You can check the old version here.

The following was added:

1. Registration fields:

  • email confirmation
  • password confirmation
  • country
  • recaptcha

Email confirmation and password confirmation are configurable fields. By default they are shown, but if you wish to remove one or both of them you have to set it in the file constants.php:

define("REPEAT_EMAIL",true);
define("REPEAT_PASSWORD",true);

2. Table fields:

  • the user ip,
  • number of logins of a user,
  • flag is_admin
  • flag is_blocked
  • new table – Country table

3. dbcontroller class sanitizes user input data

4. Edit Account Area

5. Admin Area – incomplete (for next version)

For now just the list of users is shown and a world map indicating where the users come from.  You can delete Users and set them as Admins. If there are no users to list, no map is shown. Also the User seeing the panel is not shown.
Note that in the demo you will not be able to see the admin part – for admin reasons 🙂

6. New CSS

7. Some other small details in the php code.

For the next version I am planning to :

  • add all admin functions
  • improve and improve ….

To use the recaptcha you need to get a public/private key here . Then you need to define them in constants.php:

define("PUBLICKEY","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
define("PRIVATEKEY","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

In order to use the demo for those who have registered in the previous version’s demo, you need to register again (in the demo login system), since I had to set up another database for it.

Hope you like it. Any suggestions or improvements are welcome!

DEMO

Download the source code here

Tagged with:

chadking

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.

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

Stay up to date with the latest web design and development news and relevant updates from Codrops.

CSS Reference

Learn about all important CSS properties from the basics with our extensive and easy-to-read CSS Reference.

It doesn't matter if you are a beginner or intermediate, start learning CSS now.

Feedback 287

Comments are closed.
  1. Pingback: PHP Login System Reloaded | Codrops

  2. Chad hi again.

    the demo here shows very good improvements to the system, i love it. though i was unable to see the number of users logged in at the moment.

    How about in the next version you av something like a homepage where after a user been logged in, has a place to begin from. and a user profile, forum and how you can deny a logged in user access to other pages. for example we can demonstrate this by admin where they cant login unless is admin.

    thanks and keep up the good work.

  3. Awesome work! Thank you for releasing an updated version, ive just installed it and it seems to be working perfectly.

  4. love it! this is such a huge improvement on the old script.

    something that might be good is give the user 5 oppertunities to register / login successfully and then block their IP for 15 mins. this is to stop spam bot registrations trying to brute force the capcha.

    thanks again for an awesome script

    • Hi,
      which php version do you have?
      Is that the link where you have deployed the script? I dont see the login page…
      Maybe if you could have it there, I could take a look..!?
      greetings

    • ok I see,
      you mean http://www.ajits.net/loginsystem/public_html/

      As far as I see you have another problem in the main index (public_index.php), this is because you have “<?" instead of "<?php" somewhere in that file. Some engines suport both others not. I thought I corrected that but I must have missed one! If you download the updated version you will have that fixed already (I hope).

      For the captcha image, can you try to rename the file image.jpg (under images/captcha/) to image.php ?

      Please let me know if it worked.

      greetings

  5. Fantastic script 🙂 i DL this because my PHP mysql ability is nowhere near this, i do have an issue with the registration link….

    i get this:

    Parse error: parse error in C:\wamp\www\login2\register\index.php on line 104

    any ideas?

    Sorry about this, i figure the best way to fix is to ask 🙂

    • Hi,
      thats a “}” in that line right?
      I saw that I forgot again in line 28 of that same file to replace “<?" for "<?php". Maybe that can be the problem!? pls let me know!
      greetings

  6. Thanks for the excellent script!! 🙂

    The change of image.jpg to image.php worked just file.

    Thanks!

  7. On a specific note, im trying to create a website fo rmy local aikido club, any way you can advise me to add a few details onto the personal info page?

  8. Chadking greetings.

    i was wondering if we could have 2 levels of administrators. where one (level 9) is the owner of the site who can manage other administrators and the other users while the other (level 7) is only able to manage the registered users (level 1) or guests. can we also create users profiles with fotos loaded?

    simply helping you help me. greetings.

  9. Also Id love the option for a normal memeber and then a “special” member. It would be fantastic to have an option to upgrade from a normal member to a special member with a paypal payment but I might be pushing my luck with that. 😛

  10. hi

    Cant wait till the update.

    BTW, how do u make certain pages secure, ie u have to be logged on in order to see them ???
    Can u help me ?

    Cheers

    • Hi,
      the pages like edit account page are pages that you just can see if you are logged in. There’s always a check to see if the user is authenticated before the page is rendered. If he is not logged in then he is redirected to the main page.
      if($objCore->getSessionInfo()->isLoggedIn()){
      //html to render
      }
      else
      header("Location: public_html/index.php");

      greetings

  11. Thank you.

    How do i change the style of the login box. I was trying to get a black background to fit in with my site?
    I went to the css style sheet, changed the background color for each part but it didnt seem to work, it just stayed the same?
    I’ve messed around with the style sheet but I just cant get anywhere?

    Thanks so much.

    Cheers

    • Hi,
      You need to change the background-color of
      form.login , form.register, form.editaccount, .forgotpw, .adminpanel{
      position:relative;
      height:auto;
      margin:0 auto;
      border:1px solid #ccc;
      background-color:#fff;
      -moz-border-radius: 20px;
      -webkit-border-radius:20px;
      padding:20px;
      text-align: left;
      }

      greetings