Login Script Doc

Documentation for Login Script:

View plain text

Login script
v0.1 by pyr0t3chnician
^^^^^^^^^^

(A) Installation (A)
Installation is easy.
1.  Copy and paste the code.
2.  Edit lines 23, 28, and 29 to reflect your mysql database.
3.  If you are using md5 encryption to store the password, replace
    line 35 with: 	if($row['Pass']!=md5($pass)){
4.  Save it.  Typically it is place in a sub directory (admin, login, etc)
5.  At the top of EVERY page, include this code:
    include_once("{yoursubdirectory}/user.php");
    if(!$logged)
        header('location: {yoursubdirectory}/login.php');
    Where "{yoursubdirectory}" is replaced with what ever directory
    you chose.
6.  That's it.

(B) Usage (B)
By simply following the installation steps, it will work.  There are no
functions that you need to know or use.

(C) Customization (C)
Any of the HTML code can be easily customized.  Just copy and paste
the code you would like into the area that needs it.

(D) Advance function explanation (D)
login.php
   If you are already logged in, it will display a message saying you are
       already logged in.
   If not, it will check to see if you just submitted a form.  If you did,
        it will validate the login.  If there are any errors, it will display the
        the errors.  If there are no errors, it will log you in, and display the
        "you are now logged in" message and redirect you.
   If you haven't submitted the form yet, it will display the login form.
user.php
    It sets default variables from session variables and then checks to
        see if those session variables exist.  If they do exist, then you are
        currently logged in, and then updates the default variables.
    Each of the functions do exactly what the name of the function is.
        displayLogin() - displays the login html form.
        validateLogin() - validates the login form.
        displayErrors($error) - displays the errors with a new form.
        displayLoggedIn() - displays the logged in screen and redirects.