Location: PHPKode > scripts > Coopercentral Login > Coopercentral_Login_2.0/members/README.txt
Coopercentral Login 2.0
created by Ken Cooper
Coopercentral.net

Thank you for choosing Coopercentral for your PHP scripts

*******************************************

TO INSTALL FOLLOW THE STEPS BELOW

1.) Open up functions.php with any text editor (notepad, wordpad, etc).  There are 6 variables that need to be defined, including:
    - the names of users tables that need to be created
    - your MySQL database settings
    - the name of the session used, default is "my_members"
    - the "folder" in which this poll is within.  I recommend not having this on your home root but on its own folder (the default is memberes)

2.) Once functions.php is all set, upload the files via FTP or your webserver's file manager

3.) Open a browser and point to: http://www.yourdomain.com/path-to-members/install.php

4.) The database settings you supply in functions.php will be populated in the textboxes

5.) Enter a username/password for an administrative account.

6.) To password protect a page, include the functions page, and call the show_login() function, for example:

<?php
include("/members/protected.php");
show_login();

//page content here
?>

7.) Notice on functions.php on the show_login() function, there are 3 instances of die(), which is how the script gets out of the actual pages
    and only shows the login form.  Look at lines 81, 87, and 97.

    If you want to show more than just the login page, I recommend you create a header function, include that ABOVE the form, AS WELL AS the two error messages,
    AND a footer page (if required) RIGHT BEFORE the die() functions.  I added comments for all 3 spots where you should include a header/footer function.

8.) If you have any questions or issues go to http://www.coopercentral.net/ticket/open.php

9.) If you want to create a page for Admins, simply include the functions.php page, and call the isAdmin() function.  Such as

<?php
include("/members/functions.php");
if(isAdmin()) {
  // user is an admin
  // show admin page
} else {
  // user not an admin
  echo "Sorry, this page is for admins only
}
?>
Return current item: Coopercentral Login