Set of PHP files to help create a login and registration module.
PHP JavaScript
Latest commit 25259e2 Oct 23, 2015 @tradesouthwest added session greeter
line 21 - if session set, print user name.
Permalink
Failed to load latest commit information.
inc update dbh.php Oct 5, 2015
tsw-login-register First stage Oct 5, 2015
activate.php typos Oct 14, 2015
footer.php First stage Oct 5, 2015
header.php typo Oct 23, 2015
login.php added session greeter Oct 23, 2015
myaccount.php First stage Oct 5, 2015
nav.php First stage Oct 5, 2015
readme.md add demo Oct 23, 2015
register.php remove public info Oct 14, 2015
registration.php First stage Oct 5, 2015
reset.php First stage Oct 5, 2015
restrict.php First stage Oct 5, 2015
tsw_activate.php First stage Oct 5, 2015
tsw_change.php First stage Oct 5, 2015
tsw_myaccount.php First stage Oct 5, 2015
tsw_mylogin.php First stage Oct 5, 2015
tsw_register.php filter repair Oct 14, 2015
tsw_registration.php First stage Oct 5, 2015
tsw_reset.php First stage Oct 5, 2015
tsw_resetPassword.php First stage Oct 5, 2015

readme.md

TSW Login-Register

Overview

  • PHP, HTML5, Twitter Bootstrap, jQuery
  • Creates three SESSIONs to use for retrieving data
  • PDO prepared statements
  • Using MySQL - sql table included
  • Checks for duplicate email on registry
  • Inserts MD5 password
  • Password confirmation (enter twice)
  • Great start for any medium to small size membership program
  • Easily adaptable to about any PHP script
  • Bootstrap HTML5 forms and pages
  • Forgot password and Reset password
  • Register and confirm registry through email
  • No Salt no Hash... TODO
  • several security functions and sanitizers
  • all fields are preset jquery or html5 validate

Code Example

    // check database for duplicate email
    $query = $dbh->prepare("SELECT email FROM tsw_members
                            WHERE email = :email 
                               "); 
    $query->bindValue(':email', $email);
    $query->execute();
    if($query->rowCount() > 0)
    {
        esc("<p>This email has already been registered.</p>");

Motivation

I had troubles with some open source reigistration and login scripts being either too complex or not secure enough. This is my final answer to a secure enough system which can be used for small to medium size membership login systems. I wanted to have the usage generalized enough that it could be adapted to about any PHP project that I work on.

Installation

Very basic PHP Apache Server, LAMP style install:

  • create a database or just add the one table to an existing database
    • the table is in the inc directory; file named sql.txt
  • add files where needed into directory structure
  • add settings in file inc/settings.php and connection in inc/dbh.php
  • send donation to Larry... lol :-)

Also note install can be uploaded and ran as a standalone Website (albeit Bootstrap theme-able). demo: http://tradesouthwest.com/dev/tswlogin/login.php

Contributors

Open for contributions.

License

Licensed under Apache Open Source. You can use this script for free for any private or commercial projects. http://www.apache.org/licenses/LICENSE-2.0