CyberGL
search in CyberGL only
1 Visitor, 0 Member logged in
Signup » Activation » Login
Newer version of phpMember is available,
released on 04 November 2002, has been downloaded for 16915 times.
Please visit phpMember ver 0.1.0 to get more information.

phpMember ver 0.0.3 Documentation

General Information

Please read the INSTALL file for installation instructions.

phpMember is split into three parts:

  1. An administration interface, accessible through http://<yourdomain>/<PathToPhpMember>/admin/
  2. A web interface for your members, accessible through http://<yourdomain>/<PathToPhpMember>/
  3. A backend, which handles protected page.

The Admin Interface

Through this web based control center, you can manage your members.

The Member Interface

Your members can sign-up and administer their account.

The Backend

You can protect pages from non-member visitors by inserting a code fragment below into a php-powered page so only valid member can read the page. On every page you want to protect, you have to include config.php and authentication.php. These files are in your phpMember-module-installation-directory. Authentication performed using the authenticate()-function. This function has the following syntax

string authenticate(string login, string password );

this function return error message if failed and return null if succeed.

See the usage example below :

<?
require("require/config.php");
require("require/authentication.php");
?>
<html>
    <head>
      <title>phpMember demo</title>
    </head>
  <body>

<?
if ($HTTP_POST_VARS) {
# check if there is login-password submitted
    $error=authenticate($login, $password);
# authentication
    if ($error) {
          # check whether the authentication fail
        ?>
           
Your <b>failed-authentication-member</b>
           
see this "<?echo $error?>" message
        <?
    } else {
                 # the authentication success
        ?>
           
Your <b>valid-member</b> see this HTML code
        <?
    }
                        # end if error
} else {
               # no submit
    ?>
       
Your <b>non-authenticate-visitor</b> see this HTML code
    <?
}
                      # end if submit
?>

</body>
</html>

To supply the restricted-page with login-password you must add a login form below to the source page which set the restricted-page URL as a destination action.

<form action="/URL/of/restricted/page.php" method=post>
Login : <input type=text name=login><br>
Password : <input type=password name=password><br>
<input type=submit value=Login>
</form>

So theoretically there are two pages where the first page as source-page with submit-form inserted and the second page as destination-page with authenticate()-function inserted. But technically the destination-page and source-page could be the same file.

If you want to make a serial appearance of restricted pages you can make your PHP script remember the login value but your member still have to supply a password. The form would be look like this:

<form action="/URL/of/restricted/page.php" method=post>
<input type=hidden name=login value="<?echo $login?>">
Supply Password : <input type=password name=password><br>
<input type=submit value=Login>
</form>

Insert form above in the destination-page which became source-page for the next authentication. To supply variable $login with login value you must insert it in the valid-member-code part not in the failed-authentication-member-code or non-authenticate-visitor-code part.

Login Form
Login:
Password:
Lost Password?