PHP Classes

PHP Login System: Create a system to manage users that access a site

Recommend this page to a friend!
  Info   View files Example   Demos   Screenshots Screenshots   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 481 This week: 1All time: 5,940 This week: 560Up
Version License PHP version Categories
loginsystem 1.0.0Custom (specified...5HTML, PHP 5, Databases, User Management
Description 

Author

This package can be used to create a system to manage users that access a site.

It provides classes that can perform several actions to create a MySQL database table using MySQLi to store records that will contain user details like user name, email, password, role, login date, etc.. The package can also:

- Register a new user
- Authenticate a given user
- Output HTML for pages to register, login and recover passwords of users

Picture of Win Aung Cho
  Performance   Level  
Name: Win Aung Cho is available for providing paid consulting. Contact Win Aung Cho .
Classes: 11 packages by
Country: Myanmar Myanmar
Age: 60
All time rank: 25124 in Myanmar Myanmar
Week rank: 411 Up2 in Myanmar Myanmar Up
Innovation award
Innovation award
Nominee: 3x

Recommendations

Example

<?php
/******
 * LoginSystem Class
 * User data are stored in SQL database
 * Script create table for member data if there is no table in database.
 * Script add admin acount with username and password both are "admin".
 *
 * Usesage
 * Include this class file at the begining of your page.
 * Assign $mypage variable before including class.
 * Place
 * echo$logsys->getMsg()
 * echo $logsys->getHtml();
 * anywhere in page for the message and form of login status.
 * Look into index.php as an example. Replace index.php with your page.
 *
 * This class is free for the educational use as long as maintain this header together with this class.
 * Author: Win Aung Cho
 * Contact winaungcho@gmail.com
 * version 1.0
 * Date: 28-9-2020
 ******/

$mypage=1;
include(
"userclass.php");
session_start();
//$logsys = new LoginSystem();
$logsys = new LoginSystem("localhost", "_user", "password", "database");
$logsys->runsystem();

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login</title>
    <style type="text/css">
        body{ font: 14px sans-serif; }
        .usercontent{
            margin: auto;
            width: 320px;
            border: 3px solid #73AD21;
            padding: 10px;
            overflow: auto;
            white-space: nowrap;
        }
    </style>
</head>
<body>
    <div class="usercontent">
    <?php
   
echo "<span style=\"color:red\">".$logsys->getMsg()."</span>";
    echo
$logsys->getHtml(); ?>
<p>This page is an example using LoginSystem class. At the begining of the page, include following code.</p>
    <code>
    &lt;?php <br/>
    &emsp; $mypage=1; <br/>
    &emsp; include("userclass.php"); <br/>
    &emsp; session_start(); <br/>
    &emsp; $logsys = new LoginSystem("localhost", "user", "password", "databasename"); <br/>
    &emsp; $logsys->runsystem(); <br/>
    ?&gt; <br/>
    </code>
    <p>
        Write 2 string variables at anywhere in page.
    </p>
    <pre>
        $logsys->getMsg();
        $logsys->getHtml();
    </pre>
    </div>
</body>
</html>


Details

LoginSystem

User login system for the webpages using PHP and SQL.

/ * LoginSystem Class * User data are stored in SQL database * Script create table for member data if there is no table in database. * Script add admin acount with username and password both are "admin". * * Usesage * Include this class file at the begining of your page. * Assign $mypage variable before including class. * Place * echo$logsys->getMsg() * echo $logsys->getHtml(); * anywhere in page for the message and form of login status. * Look into index.php as an example. Replace index.php with your page. * * This class is free for the educational use as long as maintain this header together with this class. * Author: Win Aung Cho * Contact winaungcho@gmail.com * version 1.0 * Date: 28-9-2020 /


  Demo LoginSystemExternal page  

Open in a separate window

Screenshots  
  • Screenshot_20200928-205445_Chrome.jpg
  • Screenshot_20200928-205509_Chrome.jpg
  Files folder image Files  
File Role Description
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Data Description
Accessible without login Image file Screenshot_20200928-205538_Chrome.jpg Data Screenshot
Plain text file userclass.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:481
This week:1
All time:5,940
This week:560Up