- PHP
- Apache server
- MySQL Database
- SQL
All of these requirements can be completed at once by simply installing a server stack like
Xampp
-
Import the
DBcreation.sqlfile in theincludesfolder into phpMyAdmin. There is no need for any change in the .sql file. This will create the database required for the application to function. -
Edit the
dbh.inc.phpfile in theincludesfolder to create the database connection. Change the password and username to the ones being used withinphpMyAdmin. There is no need to change anything else.
$serverName = "localhost";
$dBUsername = "root";
$dBPassword = "";
$dBName = "loginsystem";
$conn = mysqli_connect($serverName, $dBUsername, $dBPassword, $dBName, 3307);
if (!$conn)
{
die("Connection failed: ". mysqli_connect_error());
}The port number does not need to be changed under normal circumstances, but if you are running into a problem or the server stack is installed on another port, feel free to change it, but do so carefully. (Example if 3306 is currenlty in used, change current port to 3307)
The database already contains two pre-made accounts for you to explore around with. If not sufficient, head over to the signup page and start making new accounts.
username: admin
password: admin
username: user
password: user
Note: The GUI files are in the
root directory, and thebackend filesare present in theincludesfolder. The main HTML structuring files are theHTML-head.phpandHTML-footer.php, which also reside in the includes folder
PHP 7.3.9
SQL 14.0
HTML5
CSS3
XAMPP
Windows 10
MySQL Database
phpMyAdmin 4.9.1
MySQLi APIs
BootStrap
Details of important Features of the Application
- Registration is done through the
signuppage. usernamecannot be changed after signing up which exploitable weaknessstaridrequired for registration- Password needs to be re-entered for additional confirmation
- Passwords
encryptedbefore being stored in database so even owners donot have access to them - Implemented several
authentication methodsto verify user info before registering him. - Authentication checks for:
empty fieldsinvalid username or emailpassword mismatchSQL errorsinternal server errors
usernameandpasswordrequired for logging in.- Authentication checks to return valid error messages.
- Authentication checks for:
wrong usernamewrong password
-
Password hashingbefore storing in database. -
Filtering of information obtained from
$_GETand$_POSTmethods to preventheader injection. -
Implementation of
MySQLi Prepared Statementsfor advanced database security.Example:
$sql = "select uidUsers from users where uidUsers=?;";
$stmt = mysqli_stmt_init($conn);
if (!mysqli_stmt_prepare($stmt, $sql))
{
header("Location: ../signup.php?error=sqlerror");
exit();
else
{
mysqli_stmt_bind_param($stmt, "s", $userName);
mysqli_stmt_execute($stmt);
mysqli_stmt_store_result($stmt);
}