Final Report Web1
Final Report Web1
Student
: NGUYEN TIEN DAT
Name
Student ID : 001366257
Instructor : Huong Vu
Submission
: 12/11/2024
Date
Table of Contents
I. ABSTRACT.....................................................................................................4
II. INTRODUCTION............................................................................................4
III. METHODOLOGY...........................................................................................4
3.1 Tools & Technologies...............................................................................4
3.2 Configuration of the Development Environment....................................5
IV. USER REQUIREMENTS.................................................................................6
4.1 Requirements.........................................................................................6
4.2 User Requirements.................................................................................6
4.3 Use Case Diagram..................................................................................8
V. DESIGN.......................................................................................................10
5.1 Design of Database Schemas...............................................................10
5.2 System Architecture Overview.............................................................11
5.2.1 Overview........................................................................................11
5.2.2. Architectural elements..................................................................12
5.2.3 Scalability and Maintenance...........................................................17
5.2.4 Aspects of Security.........................................................................18
5.2.5 Maintainability and Scalability........................................................18
5.3 Design of User Interfaces.....................................................................19
VI. THE IMPLEMENTATION..............................................................................29
6.1 Includes folder......................................................................................29
6.2 Admin Folder.........................................................................................30
6.3 User Folder...........................................................................................41
6.4 public files............................................................................................50
VII. DISCUSSION ABOUT GDPR.......................................................................57
VIII. TESTTING................................................................................................58
IX. CHALLENGES, SOLUTIONS AND RESULTS..................................................60
9.1 Challenges............................................................................................60
9. 2 Results.................................................................................................61
9.3 Discussion.............................................................................................61
9.4 Ethical Considerations..........................................................................62
X. CONCLUSION AND RECOMMENDATIONS....................................................62
10.1 Conclusion..........................................................................................62
10.2 Recommendations..............................................................................63
XI. REFERENCES.............................................................................................64
Table of Figures
Figure 1:Database Schema Design................................................................10
Figure 2: Guest Page......................................................................................19
Figure 3: Page that displays a list of questions for guest...............................20
Figure 4: Student Login Page.........................................................................20
Figure 5: Admin login page............................................................................21
Figure 6: New account registration page.......................................................21
Figure 7: Home page for users.......................................................................22
Figure 8: Forum question list page.................................................................23
Figure 9: User question list page...................................................................23
Figure 10: New question addition page.........................................................24
Figure 11: Admin request page......................................................................24
Figure 12: User personal information overflow..............................................25
Figure 13: Modules information display page................................................26
Figure 14: Administrator home page.............................................................26
Figure 15: Page displaying list of questions...................................................26
Figure 16: Page displaying list of student requests........................................27
Figure 17: Student account management page.............................................27
Figure 18: Modules management page..........................................................28
Figure 19: DatabaseConnection.php..............................................................29
Figure 20: DatabaseFunction.php..................................................................29
Figure 21: add_module..................................................................................30
Figure 22: admin_home.php..........................................................................31
Figure 23: answer_request.php......................................................................31
Figure 24: delete_module.php.......................................................................32
Figure 25: delete_question.php......................................................................33
Figure 26: delete_request.php.......................................................................34
Figure 27: delete_user.php.............................................................................35
Figure 28: edit_module.php...........................................................................36
Figure 29: list_questions.php:........................................................................37
Figure 30: list_request.php.............................................................................38
Figure 31: manage_user.php..........................................................................39
Figure 32: module.php...................................................................................40
Figure 33: add_question.php..........................................................................41
Figure 34: delete_comment.php....................................................................42
Figure 35: delete_question.php......................................................................43
Figure 36: edit_question.php.........................................................................44
Figure 37: home.php......................................................................................45
Figure 38: list_questions.php.........................................................................45
Figure 39: module.php...................................................................................46
Figure 40: my_questions.php.........................................................................47
Figure 41: profile.php.....................................................................................48
Figure 42: request_to_admin.php...................................................................49
Figure 43: admin_login.php............................................................................50
Figure 44: adminstyle.css..............................................................................51
Figure 45: index.php......................................................................................52
Figure 46: login.php.......................................................................................52
Figure 47: logout.php.....................................................................................53
Figure 48: public_home.php...........................................................................53
Figure 49: public_list_questions.php..............................................................54
Figure 50: register.php...................................................................................55
Figure 51: style.css........................................................................................56
I. ABSTRACT
This report explores the design and implementation of a CRUD (Create,
Read, Update, Delete) website to facilitate student discussions and enhance
peer-to-peer learning. The system, built with PHP PDO and MySQL, provides
essential features such as posting, editing, and deleting questions, alongside
user and module management. Emphasis is placed on data security, web
accessibility, and compliance with GDPR guidelines. Through detailed
documentation of the development process, including interface design,
database architecture, and testing, the report offers insights into web
development best practices. References to recent studies and articles from
reputable sources such as BBC, The Guardian, and TechCrunch contextualize
the work within the broader scope of educational technology.
II. INTRODUCTION
The rapid evolution of digital technologies, particularly during the COVID-
19 pandemic, has reshaped education, with online platforms becoming
essential for learning and interaction. This report outlines the development of
a CRUD-based web application for student interaction, designed to replicate
the functionality of platforms like Stack Overflow. The system emphasizes
usability, accessibility, and data security, drawing from user experience
principles (Krug, 2014) and web accessibility guidelines (ISO, 2019). It
employs secure coding practices using PHP PDO and MySQL to safeguard
data integrity, addressing security concerns in educational technologies
(Heater, 2023). The report also covers the development process, challenges,
and future recommendations for ethical web development in education.
III. METHODOLOGY
3.1 Tools & Technologies
I used the following technologies and tools to create the web-based
PHP/MySQL CRUD system:
• Programming Language: The core functionality of the system is
implemented using PHP for server-side scripting and HTML for the
structure of the web pages, in addition to CSS files for adding a catchy
look and feel to enhance the user experience. This combination allows for
dynamic content creation and user interaction.
• Styling Framework: To enhance the visual appearance of the
application, I used Tailwind CSS, a utility-first CSS framework. Tailwind
allows for fast and responsive design without extensive custom styles.
• Database Management System: The application uses MySQL as its
database management system, providing a robust platform for storing
and retrieving data.
• Integrated Development Environment (IDE): For coding and
development, I used Visual Studio Code. This IDE provides a user-friendly
interface and supports various extensions to enhance coding productivity
and efficiency.
• Local server environment: Development is done on a local server
using XAMPP, which provides an easy-to-use package that includes
Apache, MySQL and PHP, making it suitable for local application testing.
Requirement Description
Users have the ability to create, edit, and delete
their own posts, and view the list of questions from
all other users, promoting active participation and
An Interactive
content management. The platform will support
Educational Setting
interactive features such as Show photos and add
modules to increase engagement.
Content will be categorized according to predefined
modules or topics to streamline navigation and
Management of relevance. Features will include filtering and search to
Content help users find posts or information quickly and
scientifically
The platform will allow embedding images,
screenshots, or uploads from devices and other
Use Cases:
o Login:
o Register:
o Navigation at Home:
o Question Page:
Add question:
Actors: Student
List Questions:
Description:
For Students:
Two buttons: one to view all their own
questions and one to view questions
submitted by other students.
For Guests:
For Admins:
o Admin Area:
o User Management:
List Users:
Actors: Admin
Delete Users:
Actors: Admin
o Module Management:
List Of Modules:
Actors: Admin
Actors: Admin
Actors: Student
Account information for system users is kept in the user table. Along
with other information to update the student profile page, such as
address, about, company, and the time the user performed actions on
the site, it also contains an ID for unique identification, a username that
must be unique for each user, a password for secure authentication, and
a role to distinguish between "admin" and "student." In order to manage
user accounts and their tasks inside the system, this table is essential.
5.2.1 Overview
The question forum system is an online tool created to let students ask
and handle questions about assignments. It offers administrative control,
question management, and user authentication. The system is set up with
many parts that communicate with one another via a clear architecture.
5.2.2.2 Server-Side:
Technologies at the backend:
5.2.2.3 Database:
The database employs a relational structure, leveraging MySQL to
manage data efficiently. The design follows normalization principles to reduce
redundancy and enhance data integrity. Referential integrity between tables
is enforced using foreign keys, ensuring that operations such as deletions in
one table do not lead to orphaned records in another. A report by the MySQL
Documentation team (2023) underscores the importance of structuring
databases with future scalability in mind, an approach adopted in this project
to accommodate potential feature expansions such as analytics and search
functionalities.
Database Structure:
• MySQL: Holds application information like as users, questions, modules,
admin, request_to_admin.
Tables in databases:
/templates: Contains html.php files that display the interface for the
entire student (user) and admin system and also the interface when
visitors access it.
o add_module.html.php: The interface adds a new module with a
form for entering names, descriptions, and error handling.
o add_question.html.php: The interface adds questions with a form
to enter a title, content, select a module, upload a photo and
process a successful notification.
o admin_layout.html.php: Admin interface with sidebar manages
questions, requests, students, modules, and displays key content
from $output variables.
o admin_list_question.html.php: The interface displays a list of
questions with titles, contents, images, related modules, questioner
information, and a button to delete questions with confirmation.
o admin_login.html.php: Log in form for admins with fields to enter
email, password, and display an error message if applicable.
o admin_register.html.php: The form registers an administrator
account with fields to enter name, email, password, confirm
password and check password in the correct format.
o answer_request.html.php: Interface for administrators to
respond to requests with a form that displays questions and enters
answers.
o edit_module.html.php: Module information editing interface with
name, description, and update button fields.
o edit_question.html.php: a form interface for editing a question,
allowing the user to update the title, body, select a module, upload
an image, and optionally delete the current image.
o home.html.php: This is a heading element displaying the text
"Welcome to the question forum," likely serving as an introduction
to a forum page where users can post and answer questions.
o layout.html.php: A webpage layout for a guest user, featuring a
sidebar with navigation links to the home page, list of questions,
student login, and admin login, along with dynamic content output
and a footer displaying the current year.
o list_module.html.php: A page displaying a list of all modules,
showing the module name and description, with a message if no
modules are found.
o list_request.html.php: A page displaying a list of requests with
options to view, answer, or delete each question, along with error
handling and a message if no questions have been asked.
o login.html.php: A login form where users can enter their email
and password, with error handling and a link to the registration
page for new users.
o manage_module.html.php: A page displaying a list of all modules
with options to add, edit, or delete modules, along with a message if
no modules are found.
o manage_user.html.php: A page displaying a list of users
(students) with their name, email, and account creation date, along
with an option to delete a user. If no users are found, a message is
shown.
o my_questions.html.php: Displays a list of a user's questions with
search functionality and options to edit or delete their own
questions.
o profile.html.php: Allows users to view and update their profile
information, such as email, full name, address, and company.
o public_list_questions.html.php: Displays a list of questions with
details such as title, body, image, module, author, and creation
time.
o register.html.php: This file contains a registration form with
validation for username, email, password, and password
confirmation, displaying error messages for invalid inputs.
o request_to_admin.html.php: This file allows users to submit
requests to the admin and view their previous requests and
responses.
o user_layout.html.php: This file defines the layout for a user
dashboard, including navigation links for various user functionalities
such as viewing questions, adding new questions, sending requests
to the admin, and managing the user's profile.
o user_list_questions.html.php: This file displays a list of questions
with an option to search for specific questions, and allows users to
edit or delete their own questions. It also shows a success message
if applicable.
/uploads: This is the folder where the images added to the question are
stored and updated by the user.
/user: Contains php files that display commands and queries, and handle
functions for the student (user) page.
o add_question.php: Handles user submission for adding a new
question, including optional image upload, and saves the data to
the database.
o delete_comment.php: Allows a user to delete their own comment,
verifying the comment's ownership before performing the deletion.
o delete_question.php: Deletes a question and its associated image
(if it exists), ensuring that the user is authorized to perform the
deletion before proceeding.
o edit_question.php: The script allows logged-in users to edit their
question, including title, body, module, and image. It handles image
uploads and deletions, then redirects to the question list after
successful update.
o home.php: The script checks if the user is logged in and assigns a
default "Guest" username if not. It then loads the homepage
template.
o list_questions.php: The script displays a list of questions with an
optional search filter. It fetches data from the database and shows
success messages if available.
o module.php: The script retrieves and displays a list of modules
from the database for logged-in users. If no modules are found, it
shows an empty list.
o my_questions.php: This script retrieves and displays questions
created by the logged-in user. If an error occurs, it shows an error
message.
o profile.php: After updating the logged-in user's profile, this script
displays a success message and reroutes to the profile page.
o request_to_admin.php: This script allows logged-in users to
submit questions to the admin and view their previous questions.
/admin: Contains php files that display commands and queries, handle
functions for the admin page
o add_module.php: This script allows adding a new module to the
database through a form. Upon submission, it inserts the module and
redirects to the module list.
o admin_home.php: This script sets a default username for the
session if not logged in, and then displays the home page using the
`home.html.php` template within the admin layout.
o answer_request.php: This script allows admins to answer user-
submitted questions and updates the response in the database.
o delete_module.php: Using the module's ID supplied by the URL,
this script removes it from the database.
o delete_question.php: Using the ID supplied by the URL, this script
removes a question from the database before rerouting to the
question list.
o delete_request.php: Using the `id` supplied in the URL, the script
deletes a request from the database and reroutes to the request list
page.
o delete_user.php: This script deletes a user by ID from the database
and redirects to the user management page, or shows an error
message if something goes wrong.
o edit_module.php: The script allows an admin to edit a module's
name and description, and updates the module in the database upon
submission.
o list_questions.php: The script retrieves all questions from the
database, with an optional search feature based on title, body, or
module, and displays them in the admin panel.
o list_request.php: This script retrieves and displays all user-
submitted questions from the `request_to_admin` table, ordered by
the most recent, in the admin panel.
o manage_user.php: This script retrieves all user records from the
`users` table, ordered by creation date, and displays them in the
admin panel for user management.
o module.php: This script fetches and displays all modules from the
database for admin management. If an error occurs, it shows an error
message.
Public:
o admin_login.php: Admin login is handled by this script. If
successful, it launches a session after comparing the supplied email
address and password with the database. If the credentials are
incorrect, it shows an error message.
o adminstyle.css: This code styles a webpage with a sidebar and
content area. The sidebar has a fixed position with a hover effect on
links, and the content area is responsive to different screen sizes.
o index.php: This file includes the `public_home.php` file, likely to
display the main public-facing page of the website.
o login.php: This PHP file handles the login functionality: it validates
user credentials from the database, starts a session if the
credentials are correct, or returns an error if they are invalid.
o logout.php: This PHP file handles the logout functionality: it ends
the current user session by destroying it and redirects the user to
the public home page.
o public_home.php: This PHP file manages the homepage
functionality: it initializes a session, sets a default username as
'Guest' if no user is logged in, and dynamically loads the homepage
content using templates.
o public_list_questions.php: This PHP file retrieves and displays a
list of questions from the database, with optional search
functionality, and handles errors gracefully.
o register.php: This PHP file handles user registration by validating
input, checking for duplicates, hashing passwords, and storing user
data in the database, with error handling included.
o style.css: This CSS defines a clean, responsive design with styles
for layout, sidebar, content, forms, and footer, emphasizing modern
aesthetics and usability.
PHP and PDO are used to validate the login credentials. Users are sent
to the relevant dashboard upon successful login. Students are
redirected to “user/home.php,” while administrators are redirected to
“admin/admin_home.php.”
Question Management:
Users can add new questions with details such as title, content, select
modules, and optionally upload images through “Add_question.php.”
Only the question owner can edit or delete their question and cannot
edit questions from other students.
Admin Functions:
Database Communication:
When you first access the website, this is the first page that users will see,
the page for others, it is a simple interface including the page name “GUEST”
and the welcome sentence when accessing “Welcome to the question forum”
– the functions that guests can access are to view the list of all questions of
all students but are limited in editing rights. There are 2 more login sections
for students and administrators for users to enter login information
Above is the page that displays the list of questions that visitors can see,
this page includes the page name "List question" displayed prominently at
the top and then the list of questions including "title, body or content" and
displays the image of the question if any. In addition, it also displays module
information, time of posting the question and the owner of the question. For
this page, visitors only have the right to view and cannot perform operations
to edit question information.
Above is the login page for students. The interface of the page is similar
to other pages including the title "login" displayed prominently at the top,
below is the email text and Password for users to enter information. After
clicking the Login button, the student's home page will be displayed if the
account is accurate; if not, an error notice will show and the user will be
prompted to input the data again. In case the user does not have an account,
click on the blue text "Register here" to create a new account.
Figure 5: Admin login page
Above is the login page for administrators. The interface of the page is
similar to the login page for students, including the title "login" displayed
prominently above, below is the email text and Password for users to enter
information. If the account is accurate after clicking the Login button, the
user will be sent to the administrator's home page; if not, an error notice will
show and they will be prompted to input their information again.
Above is the page for users to register for a new account. This page
includes the title "Register" displayed prominently on the screen and below
are the bars for users to enter information such as Username, Email, Password,
Confin Password. Users will enter information to ensure that it meets the
requirements of the website. If the requirements are met, it will be transferred
to the login page for users to start logging in. If the requirements are not met,
it will notify the user of the error they made and notify them to re-enter until
the information meets the requirements.
Above is the home page for users when they successfully log in. It is
similar to other home pages including the page name "User" displayed in
large blue letters at the top left and the welcome title "Welcome to the
question forum"
Figure 8: Forum question list page
Above is the page that displays a list of all questions posted by all
students on the forum. This page includes the title "List Questions" displayed
at the top. Next is the question search toolbar and below is a list of questions
including information such as title, body, module, poster, posting time and if
there is an image it will also be displayed in each question. On this page,
users do not have the right to edit information or delete questions of other
users, but if it is a question of that user, they can perform the editing or
deleting operation.
Above is the page that displays a list of all the questions of that user, it
also includes the same information fields as image number 8. and on this
page the user can edit the information or delete one or more questions
because all the questions in this list are from that user.
Figure 10: New question addition page
Above is the question addition page. This page displays the title "Add
Questions" on the top and below are the boxes for entering the information
of the question that the user wants to add, including title, content, select
module and add image if desired. The question will be instantly added to the
list when the user fills out all the fields and clicks the submit button. If the
information boxes are not filled in, an error will be displayed and a
notification will be displayed that the information has been entered
completely.
Above is the page displaying user information. This page includes the
title "Profle" displayed at the top and below are user information boxes such
as Username, Email, Full Name, Address, About, Company. In which the
Username and Email information is displayed directly because it takes
information when you have registered a new account through the database
storage system and with the remaining boxes, you will fill in yourself. The
information on the user can be changed and updated regularly.
Figure 13: Modules information display page
Above is the page that displays all the list of modules including the title
"All Modules" displayed prominently at the top and below is the list of
modules and information, concepts of each module.
This is the admin home page if they log in successfully. The interface is
similar to the other pages so I won't say more to avoid repeating too much
duplicate information.
Figure 15: Page displaying list of questions
This is the page that displays the list of questions of all users. For this
page, the administrator can see all information such as title, content,
module, poster, posting time. The administrator can delete all questions in
this page.
Above is the page that displays the list of requests sent from all students.
The current interface displays the title "List request" and below is the list of
student requests and the administrator can reply or delete one or all of the
requests displayed in this list.
Figure 17: Student account management page
The system's user accounts may be managed using the User Manager
page. It offers the ability to see and remove users from the list. With a simple
layout that facilitates effective user administration, the website is designed
to be user-friendly. For a contemporary and responsive design, Tailwind CSS
is utilized.
This PHP script handles adding new modules to a database using a POST
request. If the form is submitted, it retrieves the module_name and
module_description from the POST data, and inserts them into the
modules table using a prepared statement for security. The user is sent to
the module list page (module.php) upon successful insertion. If required
fields are missing or an error occurs, it shows an error page with a relevant
message. For GET requests, the script displays a form to add a module using
the add_module.html.php template. The layout is wrapped with
user_layout.html.php for consistent styling.
Figure 22: admin_home.php
Using the supplied id in the query string, this PHP script removes a
module from the database. It connects to the database, prepares a DELETE
SQL statement with the module ID as a parameter, and executes the deletion
using PDO. If successful, the script redirects to the module.php page;
otherwise, it captures and stores any error encountered during execution. If
no id is provided, it simply redirects to module.php.
Figure 25: delete_question.php
This PHP script deletes a question from the database by its id, which is
passed via the query string. It starts a session, employs a prepared DELETE
SQL query and establishes a connection to the database with id parameter
to execute the deletion securely. If successful, it redirects to the
list_questions.php page. In case of an error, it sets an error message and
includes the admin_layout.html.php template to show the error.
Figure 26: delete_request.php
Using the id supplied in the URL, this PHP script removes a particular
request from the request_to_admin database. It creates a database
connection and launches a session. It prepares and runs a DELETE SQL query
to delete the request from the database if the id is valid (higher than ,0)
Afterward, it redirects to the list_request.php page. If an error occurs, it
catches the exception and displays an error message using the
admin_layout.html.php template.
Figure 27: delete_user.php
This PHP script deletes a user from the users table based on the id
passed in the URL. It starts a session and includes the database connection.
The script retrieves the user ID, ensures it's an integer, and prepares a
DELETE SQL query to remove the corresponding record from the database.
After the deletion, it redirects to the manage_user.php page (which lists
users). If an error occurs during execution, it catches the exception and
displays an error message using the admin_layout.html.php template.
Figure 28: edit_module.php
This PHP script allows an admin to edit module details. By confirming the
session, it determines whether the administrator is logged in. The script
retrieves the current module data if the id is supplied in the URL, then allows
the admin to update the module name and description. Upon successful
submission, it updates the database and redirects to the module list page. If
the module name is empty or the update fails, an error is displayed. The
script uses prepared statements for database queries and renders the
edit_module.html.php template for the admin interface.
Figure 29: list_questions.php:
This PHP script handles searching and displaying questions for an admin.
It starts by checking if a search query (search) is provided in the URL. If a
search term is present, it appends a WHERE clause to filter questions based
on the title, body, or module. The script uses prepared statements to prevent
SQL injection. If a search is conducted, the LIKE operator matches any
questions containing the search term. After executing the query, it fetches all
matching results and stores them in an array. The results are then displayed
using the admin_list_question.html.php template, which is included in the
admin layout.
Figure 30: list_request.php
A list of queries that users have sent to the administrator is retrieved and
shown by this PHP script. First, a session is created and the required
database connection file is included. After that, a SQL query is prepared and
run to retrieve every entry from the request_to_admin table, ordered by
the asked_at timestamp in descending order. If the query is successful, the
results are stored in the $questions array. If there's an error, it catches the
exception and stores an error message. Finally, the script prepares the page
by including the list_request.html.php template to display the results
within the admin layout.
Figure 31: manage_user.php
A list of every user is retrieved and shown by this PHP script from the
database. First, the database connection file is included and a session is
established. After that, it tries to run a query to pick every user from the
users table and arrange them in decreasing order by the created_at date.
The results are stored in the $users array. If an error occurs during this
process, the exception is caught, and an error message is displayed within
the admin_layout.html.php template. If the query is successful, the script
prepares the page and includes the manage_user.html.php template to
show the user data within the admin layout.
Figure 32: module.php
A list of every module is the database and shown in the admin panel using
this PHP script. Initializing a session and adding the required function files and
database connection are the first steps. The script then queries the modules
table to fetch all the modules. If modules are found, they are stored in the
$modules array; if none are found, an empty array is assigned. The script
prepares the manage_module.html.php template to display the module list
and stores the output in the $output variable. An error message is shown if
there is a problem with the process. Lastly, the admin_layout.html.php
template for the admin view contains the content.
6.3 User Folder
Logged-in user to delete their question along with its associated image (if
it exists). The script checks if the user owns the question by verifying the
user_id and question_id in the database. If an image is linked to the
question, it is deleted from the server before the question itself is deleted.
After the deletion, It takes the user to list_questions.php. An error notice
appears if there is a problem..
Figure 36: edit_question.php
This PHP script allows a logged-in user to edit a question. It handles POST
requests to update the question's title, body, and image. If an image is
uploaded, it’s saved to the server. The current image will be deleted if the
user wishes to do so. After updating the question, the script redirects the
user to the question list page. If the request is GET, it fetches the current
question data to display in the edit form. Errors are shown if the user has no
permission or if there are issues with the update.
Figure 37: home.php
This PHP script checks if a session for the user is active. If not, it sets a
default session value of 'Guest' for the username. The script then sets the
title to 'Home', retrieves the content from home.html.php into an output
buffer, and includes the user_layout.html.php template, which will display
the page with the appropriate layout for the user.
Figure 38: list_questions.php
This script retrieves a list of modules from the database for authenticated
users. It searches the modules database, initiates a session, and verifies that
the user is logged in. If modules are found, they are fetched; otherwise, an
empty array is returned. The results are displayed using the
list_module.html.php template within the user_layout.html.php
structure. If an error occurs, it is caught and displayed as a sanitized
message.
This CSS defines a visually appealing layout with a fixed-width sidebar for
navigation and a responsive content area. The sidebar has a dark theme,
rounded links that change color on hover, and a distinctive blue header for
emphasis. The content area is clean, centrally styled, with rounded corners
and a subtle shadow. Responsive design ensures the layout adapts
seamlessly for smaller screens by making the sidebar full-width and
removing its fixed position. Footer styling complements the sidebar,
maintaining consistency.
Figure 45: index.php
This PHP script is used for logging out a user. It starts by calling
session_start() to access the current session. Then, it calls
session_destroy() to end the session, essentially terminating the user's
session. The header() method is used to redirect the user to the
public_home.php page when the session has been terminated. The user is
guaranteed to be logged out and taken to the public home page using this
script.
The PHP script starts a session, includes the database connection, and
attempts to fetch all questions from the database (with an optional search
filter). It displays the results in a template public_list_questions.html.php,
wrapped in a main layout. If any error occurs, an error message is shown.
Figure 50: register.php
The PHP script handles user registration by verifying the submitted data.
It checks if the passwords match and if the username or email is already in
use. If the validations pass, it hashes the password and inserts the user into
the database. If any error occurs (like database issues or conflicting data), an
error notice appears. The user is taken to the login page after completing the
registration process. The form and content are included in a layout template.
Figure 51: style.css
This CSS provides a clean, modern layout with a fixed sidebar, content
area, and form styles. It uses a gradient background for the body, with a
fixed sidebar featuring white text and hover effects on links. The content
section is styled with padding, a box-shadow, and rounded corners. Forms
are designed with spacious inputs and a blue submit button that changes
color on hover. The footer has a matching background and centered text. The
overall design ensures readability and a consistent, responsive user
interface.
VII. DISCUSSION ABOUT GDPR
The system adheres to WCAG 2.1 accessibility standards, integrating
features like keyboard navigation, high-contrast schemes, and descriptive alt
texts to ensure inclusivity. The growing demand for accessible educational
technologies, highlighted by a 2022 The Guardian article, emphasizes the
need for compliance. Regarding data protection, the system follows GDPR by
encrypting sensitive data and offering users control over their information, in
line with the "right to be forgotten." The ICO (2023) stresses the importance
of transparency in data usage, which the system addresses with clear
privacy policies.
Rights of Users
Security of Data
The system’s back end is built using PHP PDO, chosen for its secure and
efficient interaction with the MySQL database (PHP.net, 2023). Unlike the
procedural MySQLi, PDO provides robust support for prepared statements,
mitigating risks associated with SQL injection attacks.
HTML5 and CSS3 form the backbone of the front-end design, enhanced by
Bootstrap for consistency and ease of customization. JavaScript is employed
for client-side validation, ensuring a smoother user experience by catching
errors before submission.
VIII. TESTTING
Unit tests for individual components and integration tests for end-to-end
processes were among the testing approaches used. Manual testing was also
conducted to evaluate usability, a critical metric highlighted in Duckett
(2014).
No Functi Desired
Description Actual Outcome Image
. on Outcome
A welcome
Verify the Successful .If the
message
user's login outcome matches.
Login appears on the
1 using the Otherwise: "Invalid
Student home page
appropriate email or
when the user
credentials. password"
is routed.
A welcome
If the results
Verify the message
Login match, the test is
admin login appears on the
2 for successful.
using the right home page
Admin "Invalid email or
information. when the user
password" else.
is routed.
n information. successfully.
9.1 Challenges
a) Frontend and backend integration:
The challenge is to make sure that the backend PHP scripts and
frontend HTML forms interact efficiently, particularly when managing
user input and data uploads.
Solution: AJAX was used to facilitate data entry and retrieval, and client
and server inputs were verified to guarantee data integrity.
b) Database Schema Adjustments:
Challenge: Adapting the database schema to the project's changing
needs, including adding new features and fixing problems like missing
tables or columns.
Solution: PDO was used for safe and effective database interactions,
and database queries and schema were updated to reflect the
modifications.
c) Debugging and Error Handling:
Managing errors like "Column not found" or improper redirection that
affected the web application's operation was a challenge.
Solution: PHP scripts were debugged and fixed to guarantee that
database operations and redirection logic were handled correctly.
d) Usability and Design of User Interfaces:
The challenge is to leverage Tailwind CSS to create an intuitive user
experience while keeping it looking polished and professional.
Solution: Based on feedback, Tailwind CSS was successfully used to
produce the intended design aesthetics and enhanced usability.
e) Examining functionality:
The challenge is making sure that every feature—such as module
administration, question management, and login—functions well and
satisfies user needs.
Solution: Detailed test cases, including edge cases and error situations,
were created to verify every functionality.
9. 2 Results
a) Successful connection: Data submission and retrieval were made
possible by the frontend and backend's smooth connection. Scripts for
backend processing are now properly connected to forms.
b) Database Schema Update: The required tables and columns were
added to the database schema. Features like adding, editing, and
removing modules and questions function as planned.
c) Better Error Handling: By implementing efficient error handling, the
application's resilience was increased and the frequency of frequent
mistakes was decreased.
d) Improved User Interface: The program is now aesthetically pleasing
and easy to use after the user interface was improved to satisfy the
design requirements.
e) Verified Features: Every significant feature was examined and
verified. Test cases validated that the program functions as intended
and gracefully resolves failures.
9.3 Discussion
a) Frontend and Backend Integration: The integration procedure
made clear how crucial it is to provide seamless frontend and backend
connectivity. Data integrity and user experience depend on efficient
error handling and validation.
b) Database Schema Modifications: The necessity of schema
modifications highlighted how crucial it is to plan database structure
beforehand and be ready to make modifications when needs change.
The application's operation and stability depend on proper schema
maintenance.
c) Debugging and Error Handling: Finding and fixing faults provide
important information about typical problems encountered throughout
development. Having a strong error-handling system is essential for
creating dependable online apps.
d) Usability and User Interface Design: The design process reinforced
the need of developing an interface that is both aesthetically attractive
and easy to use. A significant tool for getting the required appearance
and experience while preserving design coherence was Tailwind CSS.
e) Functionality Testing: The thorough testing methodology made sure
the program satisfies user needs and operates as planned. Delivering a
high-quality product requires routine testing and validation.
XI. REFERENCES
1. BBC. (2022). Post-pandemic EdTech Growth. Available at: [Google
Scholar].
3. Duckett, J. (2014). HTML & CSS: Design and Build Websites. Wiley.
Available at: [Google Scholar].