PHASE FIVE COMPLETE (1)
PHASE FIVE COMPLETE (1)
CODING
SECTION
Contents
INTRODUCTION ....................................................................................................................................... 3
OBJECTIVES ............................................................................................................................................. 3
TECHNOLOGIES USED IN DREAMSHELF .................................................................................................. 4
MAIN PAGE ............................................................................................................................................. 6
REGISTRATION PAGE ......................................................................................................................... 14
SQL DATABASE ...................................................................................................................................... 23
TERMS AND CONDITIONS ..................................................................................................................... 28
WELCOME BACK LOGIN ........................................................................................................................ 34
SQL CODE FOR LOGIN ........................................................................................................................... 42
HOME PAGE .......................................................................................................................................... 44
ABOUT US.............................................................................................................................................. 52
BOOKS PAGE ......................................................................................................................................... 55
AUDIO LOGS .......................................................................................................................................... 60
GAMES SECTION ................................................................................................................................... 68
KEY SCENARIOS FOR INTEGRATION TESTING ....................................................................................... 74
TESTING METHODOLOGY ..................................................................................................................... 74
INTEGRATION TESTING TOOLS.............................................................................................................. 79
INTRODUCTION
The Dream Shelf application is designed to provide kids of the ages 6-12 with a seamless way to
catalog their personal library, discover new books and play educational and fun games.
This document outlines the implementation details for the application, including the coding
standards used, testing strategies, system testing protocols and installation instructions of software
OBJECTIVES
Facilitate a collection of children books and audio logs.
Allow kids to access both online and offline books.
Provide user-friendly interface for easy and exciting navigation.
And lastly provide kids with free educational and fun games.
TECHNOLOGIES USED IN DREAMSHELF
HTML (HyperText Markup Language):
Basic Structure: We rely on HTML to form the backbone of our webpage. It uses tags to
define the document's structure, including:
o <head>: This section contains metadata, links to stylesheets, and our document title.
o We utilize semantic elements like <header>, <nav>, <main>, and <footer> to provide
meaning and organization to our content.
Content Organization:
o Our webpage employs <a> tags extensively, which enable users to navigate between
different pages and access external resources.
Embedded Content:
Styling:
o We apply CSS to customize the visual appearance of our HTML elements. This
includes:
Color and Font Styles: We set colors for text and backgrounds, as well as
define font sizes and family styles.
Box Model: We manage spacing (margin and padding) and the sizing of
elements effectively.
Responsive Design:
o Utilizing CSS media queries and properties (including viewport settings in HTML), we
ensure our layout adapts to various screen sizes and devices, making it mobile-
friendly.
o We implement responsive techniques that scale elements and adjust layouts based
on viewport width.
Interactive Elements:
o Our CSS styles include hover effects and transitions that enhance user interaction,
making buttons more engaging and providing visual feedback.
3. JavaScript:
o Dynamic Functionality: We used JavaScript to handle events (like button clicks), load
game content dynamically, or facilitate user interactions.
4. Accessibility (a11y):
By utilizing semantic HTML, we help make our webpage more accessible to users with
disabilities. This practice includes:
By implementing proper use of headings, metadata, and descriptive links, we enhance the
discoverability of our webpage through search engines.
6. PHP
Summary of Technologies:
JavaScript: Used for dynamic interactions (a common addition, even if not explicitly included
in our initial code).
Accessibility Practices: We implement these for enhancing usability for users with
disabilities.
SEO Techniques: These are integrated through our well-structured content and metadata.
PHP: For back end and connection to local server and security purposes.
MAIN PAGE
SOURCE CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dream Shelf</title>
<link rel="stylesheet" href="style-edited.css"> <!-- Link to the external CSS stylesheet -->
<style>
/* Basic Styles */
body {
color: white;
text-align: center;
position: relative;
overflow-x: hidden;
.shape {
position: absolute;
border-radius: 50%;
opacity: 0.6;
z-index: -1;
width: 150px;
height: 150px;
background-color: #f6d365;
top: 100px;
left: -50px;
.shape.shape2 {
width: 200px;
height: 200px;
background-color: #fda085;
top: 300px;
right: -70px;
.shape.shape3 {
width: 100px;
height: 100px;
background-color: #ff6f61;
bottom: 100px;
left: 50%;
transform: translateX(-50%);
.shape.shape4 {
width: 80px;
height: 80px;
background-color: #ff5252;
top: 500px;
left: 80px;
}
/* Header styling */
header {
padding: 20px;
border-radius: 15px;
margin-bottom: 30px;
header h1 {
font-size: 3rem;
color: #ff6f61;
header p {
font-size: 1.2rem;
color: #666;
margin-top: 5px;
/* Navigation Styling */
nav a {
color: #ff6f61;
text-decoration: none;
margin: 0 15px;
font-size: 1.2rem;
}
nav a:hover {
color: #ff1744;
/* Image styling */
.shelf-image {
display: block;
padding: 10px;
max-width: 80%;
height: auto;
border-radius: 20px;
.shelf-image:hover {
transform: scale(1.05);
/* Footer styling */
footer {
margin-top: 20px;
color: #666;
font-size: 1rem;
footer p {
margin: 5px;
</style>
</head>
<body>
<header>
</header>
<style>
/* Other styles */
nav a {
nav a:hover {
</style>
</head>
<body>
<nav>
</nav>
</body>
<p style="color: white; font-size: 1.5rem; margin-bottom: 20px;">Click on the image below to
register ↓</p>
<a href="http://localhost/loginn.php">
</a>
</section>
<p style="color: white; font-size: 1.5rem; margin-bottom: 20px;">Click on the image below to log
in ↓</p>
<a href="http://localhost/welcomeback.php">
<img class="shelf-image" src="shelf image 2.jpg" alt="Library Image" style="width: 80%; max-
width: 700px; height: auto; padding: 15px; border: 3px solid white; border-radius: 15px;">
</a>
</section>
<!-- Footer Section -->
<footer>
</footer>
</body>
</html>
EXPLAINATION
This HTML document creates a simple webpage for an entity called "Dream Shelf." The page is styled
to be visually appealing, featuring playful shapes, a welcoming header, navigation links, sections for
registration and login, as well as a footer. Let’s break down the code step-by-step:
1. Document Structure
Html Element: The <html lang="en"> indicates that the content is in English.
2. Head Section
The <head> section includes metadata, linking to stylesheets, and internal styles:
Meta Tags:
o Body Style: Sets background color, font properties, and text alignment.
o Circle Shapes: CSS classes .shape define and style circular shapes for visual interest
in the background.
o Header Style: The header is styled with padding, background color, shadows, and
text styles.
o Navigation Links: Styles make navigation links visually appealing, with color
transitions on hover.
o Image Style: Images are styled to have a border, shadow effects, and scaling on
hover.
o Footer Style: Simple styling for the footer with color and text shadow.
3. Body Section
Background Shapes: Four <div> elements represent different shapes, positioned absolutely
behind the content.
Header Section: Contains a welcome message with a title (<h1>) and subtitle paragraphs
that promote the mission of "Dream Shelf."
Navigation: A <nav> section provides a link to the "About Us" page. The links change color
on hover for interactivity.
o Images are wrapped in anchor (<a>) tags linking to registration and login pages. The
images visually represent actions and are styled to enhance their appearance.
5. Footer Section
6. Issues Detected
There are two opening <body> tags, which is incorrect. Only one opening and
closing <body> tag should be present.
7. Summary
This webpage is designed to be a user-friendly portal for "Dream Shelf," focusing on both
registration and returning user logins. The playful design features circular shapes, visually appealing
text elements, and interactive links to enhance user experience. The code is structured for easy
readability and maintenance, with a clear separation of design (styles) and content (HTML structure).
REGISTRATION PAGE
SOURCE CODE
<?php
// Initialize variables
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "mydatabase";
// Create connection
// Check connection
if ($conn->connect_error) {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!preg_match("/^[A-Za-z\s]+$/", $_POST["name"])) {
} else {
$name = $_POST["name"];
} else {
$age = $_POST["age"];
if ($_POST["role"] == "") {
} else {
$role = $_POST["role"];
$sql = "INSERT INTO users (name, age, role) VALUES (?, ?, ?)";
$stmt = $conn->prepare($sql);
$stmt->execute();
$userId = $conn->insert_id;
session_start();
$_SESSION['userId'] = $userId;
$_SESSION['name'] = $name;
$_SESSION['age'] = $age;
$_SESSION['role'] = $role;
// Redirect to login page after successful registration
exit;
$conn->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
/* Basic Styles */
body {
background-color: #C9E4CA;
color: #333;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
.welcome-container {
background-color: #fff;
width: 100%;
max-width: 500px;
border-radius: 15px;
padding: 30px;
text-align: left;
margin-top: 50px;
h2 {
color: #FF69B4;
font-size: 2.5rem;
text-align: center;
label {
font-size: 1rem;
color: #666;
width: 100%;
padding: 10px;
margin: 10px 0;
font-size: 1rem;
/* Validation Messages */
.error-message {
color: red;
font-size: 0.9rem;
/* Button Styles */
.submit-button {
background-color: #87CEEB;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1rem;
width: 100%;
margin-top: 15px;
.submit-button:hover {
background-color: #FFC5C5;
</style>
</head>
<body>
<body>
<div class="welcome-container">
<h2>Register Here!</h2>
<label for="name">Name:</label>
<label for="age">Age:</label>
<label>
</label>
<br>
<br>
<fieldset>
<legend>REQUEST</legend>
<label>
A Book
</label>
<br>
<label>
More Information
</label>
</fieldset>
<script>
function showMessage(value) {
if (value == 1) {
alert("Register and get books, audio logs and many more for child or learners today!!");
} else if (value == 2) {
alert("For more information please contact us at DReam Shelf Assistance line 0838854052 or email
Us @dreamshelfhelpline.co.za");
</script>
<br>
<script>
alert("Are you Parent? , Teacher? or Guardian? Register Here to explore Books and many more for
your Kids!");
</script>
<input type="submit" action="feedback.php>" name="submit" value="Begin" class="submit-
button">
EXPLAINATION
It collects user information such as name, age, and role and stores it in a database after validating
the input. If the registration is successful, it provides feedback to the user and allows them to log in.
Key Components
1. Variable Initialization: At the beginning of the script, variables are set up to hold potential
error messages (for invalid input) and store values that the user submits through the
registration form. This gives a clear structure for managing user input.
2. Database Connection: The script defines the parameters needed to connect to a MySQL
database, including the server name, username, and database name. It establishes a
connection using these parameters and checks if the connection is successful. If there is an
error connecting, the script stops executing and displays a message.
3. Form Submission Handling: The script checks if the registration form has been submitted. If
it detects a submission (indicated by a POST request), it processes the input:
o Name Validation: It checks if the name contains only letters and spaces. If it
contains invalid characters, an error message is generated.
o Age Validation: It ensures that the user is at least 13 years old. If the age is less than
13, an error message is shown.
o Role Validation: The script checks that a role (either Parent, Teacher, Guardian, or
Other) has been selected. If not, an error message is set.
4. Successful Data Handling: If all input fields are valid, the script prepares an SQL statement to
insert the user's data into the database. It uses a prepared statement, which helps prevent
SQL injection attacks (a common security issue). After the data is successfully inserted, the
script retrieves the newly created user's ID.
5. Session Management: Once the user is registered, their information (like user ID, name, age,
and role) is stored in PHP session variables. This allows the information to be accessible on
other pages or throughout the user's session.
6. Feedback and Redirection: The script informs the user that their registration was successful
and provides a button to log in. After displaying this information, it stops further execution.
7. HTML and User Interface: The HTML portion of the code creates the visual layout of the
registration form. This includes input fields for the user's name and age, a dropdown to
select their role, and a checkbox for agreeing to terms and conditions. The form requires
users to fill in all fields before submitting.
8. Styling: Some CSS is included to make the registration page visually appealing, such as
background colors, fonts, and button styles. This enhances the user experience by making
the page more inviting.
9. JavaScript Alerts: There’s a section that includes a JavaScript function. This function shows
alerts based on whether the user is requesting a book or more information when they select
radio buttons. It provides immediate feedback to the user.
10. Error Handling and User Feedback: If any of the validations fail (like invalid name or age),
the corresponding error message will be displayed under the relevant input field, guiding the
user on what needs to be corrected.
Summary
This code is for a registration webpage that allows users to input their personal details. It includes
validations to ensure the correctness of the details provided, connects to a MySQL database to store
this information, and provides feedback to users based on their interactions. The combination of
PHP, HTML, CSS, and JavaScript creates a functional and user-friendly registration system.
SQL DATABASE
-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
SET FOREIGN_KEY_CHECKS=0;
START TRANSACTION;
--
-- Database: `mydatabase`
--
-- --------------------------------------------------------
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-- Metadata
--
USE `phpmyadmin`;
--
--
SET FOREIGN_KEY_CHECKS=1;
COMMIT;
EXPLAINATION
This SQL script represents a structured export from a MySQL or MariaDB database, typically
generated by phpMyAdmin. The script is designed to create and populate a database table named
users, which is intended to manage user records.
Key Components
1. Metadata Information:
o The dump begins with metadata comments that indicate the version of
phpMyAdmin used (5.2.1), server details (MariaDB version 10.4.28), and the PHP
version (8.2.4) at the time of the dump's generation. This information provides
insights into the environment where the SQL commands were executed.
2. Transaction Control:
o The script sets the time zone to UTC (SET time_zone = "+00:00";) and ensures that
the database uses the utf8mb4 character set. This character set supports a wide
range of characters, including emojis, which offers better compatibility for various
text types.
4. Database Creation:
o The script specifically targets a database named mydatabase, indicating the context
in which the users table should be created.
5. Table Creation:
o The CREATE TABLE statement creates a new table named users with the following
fields:
id: An integer that serves as a unique identifier for each user (not nullable).
age: A tiny integer field for storing user ages (nullable, unsigned).
role: A variable character field (up to 255 characters) for describing the
user's role (nullable).
o The table uses the InnoDB storage engine, which supports transactions and foreign
key constraints, and employs a utf8mb4 character set with a general collation.
6. Inserting Data:
o The script includes an INSERT INTO statement to populate the users table with initial
data, entering three records for users identified by their respective id, name, age,
and role.
7. Indexing:
o An ALTER TABLE statement adds a primary key constraint on the id column, ensuring
that each record in the users table is uniquely identified and indexed for
performance.
8. Auto-Increment Configuration:
o The command COMMIT; finalizes the transaction, making all changes permanent in
the database.
o The script concludes by restoring any previous character set and collation settings to
ensure the environment returns to its initial state.
Conclusion
This SQL dump file provides a comprehensive foundation for creating and populating a users table in
the mydatabase database. It showcases fundamental database management principles, including
transaction handling, proper character set usage, and data integrity through primary key constraints
and auto-increment functionality. Overall, it serves as an excellent starting point for user data
management in a relational database system.
TERMS AND CONDITIONS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
line-height: 1.6;
margin: 20px;
padding: 20px;
background-color: #f9f9f9;
color: #333;
h1, h2, h3 {
h1 {
text-align: center;
p{
margin: 10px 0;
a{
color: #00f;
text-decoration: none;
a:hover {
text-decoration: underline;
footer {
text-align: center;
margin-top: 20px;
font-size: 0.8rem;
color: #777;
</style>
</head>
<body>
<p>Welcome to Dream Shelf, a safe and fun library where kids can explore books, play educational
games, and engage in learning activities! We want to ensure that your experience here is enjoyable
and safe. By using our services, you agree to the following terms and conditions.</p>
<p>By accessing and using Dream Shelf, you agree to comply with these Terms and Conditions. If
you do not agree to these terms, please do not use our services.</p>
<h2>2. Eligibility</h2>
<p>Dream Shelf is designed for children aged 6 to 12 years. If you are under the age of 13, please
ask a parent or guardian for permission before using our website or services.</p>
<h2>3. Use of Services</h2>
<ul>
<li><strong>Library Access:</strong> You may browse our selection of books and educational
games available on Dream Shelf.</li>
</ul>
<h2>4. Content</h2>
<ul>
</ul>
<p>Your privacy is important to us! We do not collect sensitive personal information from children
without parental consent. Please read our <a href="#privacy-policy">Privacy Policy</a> for more
details.</p>
<ul>
<li><strong>Copyright:</strong> All content, graphics, and materials on Dream Shelf are owned
by us or licensed to us and are protected by copyright laws. You may not use, reproduce, or
distribute any of our content without permission.</li>
</ul>
<h2>7. Limitation of Liability</h2>
<p>Dream Shelf is not responsible for any damages that may occur from using our services. We
strive to provide a safe environment, but we cannot guarantee that our content is free from errors
or interruptions.</p>
<p>Dream Shelf may include links to other websites. We are not responsible for the content or
practices of those websites. Always verify the information before engaging with third-party
services.</p>
<p>We reserve the right to update these Terms and Conditions at any time. Any changes will be
posted on this page with the effective date. Please review this regularly.</p>
<p>If you have any questions or concerns about these Terms and Conditions, please contact us
at:</p>
<ul>
<li><strong>Email:</strong> @dreamshelfhelpline.co.za</li>
</ul>
<footer>
<p>By using Dream Shelf, you agree to these Terms and Conditions and commit to fostering a
fun, safe, and respectful environment for all users. Happy reading and learning!</p>
</footer>
</body>
</html>
Overview of the HTML Document
The HTML document is a structured representation of the Terms and Conditions for "Dream Shelf," a
platform catering to children's education and entertainment through books and games. This
document is essential for informing users—specifically children aged 6 to 12 and their guardians—
about their rights, responsibilities, and acceptable usage of the service.
Structure Breakdown
o <html lang="en">: The root element of the document, with the lang attribute
indicating that the content is in English.
2. Head Section:
<title>: Sets the title of the webpage, which appears in the browser tab.
Here, it states "Terms and Conditions - Dream Shelf."
3. Body Section:
o <body>: The main content area of the webpage where all visible elements are
placed.
<h1>: The main heading that clearly indicates the topic, "Terms and
Conditions for Dream Shelf."
<ul>: Unordered lists that outline specific points related to the categories,
such as account creation, content guidelines, and intellectual property.
Bullet points enhance readability and comprehension.
o Content: Describes the nature of the provided materials and the guidelines for user-
generated content.
o Intellectual Property: Describes ownership rights over the content and user
contributions.
o Limitation of Liability: States that Dream Shelf is not responsible for any potential
damages from using its services.
o Third-Party Links: Clarifies that external links on the site are not under the website’s
control and advises verification before use.
o Changes to Terms: Notifies users that terms may change and encourages regular
reviews of the document.
5. Contact Information:
o Provides clear channels for users to ask questions or seek clarification on these
terms, including an email address, phone number, and traditional mail information.
6. Footer Section:
o The footer offers a summary statement reiterating the user’s agreement to the
terms and encourages a respectful environment, culminating in a positive note
about reading and learning.
Conclusion
This HTML document serves as an essential legal and informational tool for "Dream Shelf." It
effectively communicates the terms under which their services are provided while ensuring that
users, particularly children and their guardians, understand their rights and responsibilities. The
structured approach, along with thoughtful styling, enhances the overall user experience, promoting
clarity and accessibility. By laying out these terms transparently, Dream Shelf fosters confidence and
trust within its community, thereby supporting a safe and educational environment for its users.
WELCOME BACK LOGIN
SOURCE CODE
<?php
// Initialize variables
$servername = "localhost";
$username = "root";
$password = "";
// Create connection
// Check connection
if ($conn->connect_error) {
// Start session
session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!preg_match("/^[A-Za-z\s]+$/", $_POST["name"])) {
} else {
$name = $_POST["name"];
// Check if name exists in first database
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $name);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows == 0) {
} else {
$age = $_POST["age"];
if ($_POST["role"] == "") {
} else {
$role = $_POST["role"];
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$user = $result->fetch_assoc();
print_r($user);
$_SESSION['userId'] = $user['id'];
$_SESSION['name'] = $user['name'];
$_SESSION['age'] = $user['age'];
$_SESSION['role'] = $user['role'];
session_unset();
session_destroy();
header("Location: mainpage.html");
} else {
session_destroy();
exit;
} else {
session_unset();
exit;
$conn->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
/* Basic Styles */
body {
background-color: #ffebcd;
color: #333;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
.welcome-container {
background-color: #fff;
width: 100%;
max-width: 500px;
border-radius: 15px;
padding: 30px;
text-align: left;
margin-top: 50px;
h2 {
color: #ff6f61;
font-size: 2.5rem;
text-align: center;
label {
font-size: 1rem;
color: #333;
}
input[type="text"], input[type="number"], select {
width: 100%;
padding: 10px;
margin: 10px 0;
border-radius: 5px;
font-size: 1rem;
/* Validation Messages */
.error-message {
color: red;
font-size: 0.9rem;
/* Button Styles */
.submit-button {
background-color: #ff6f61;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1rem;
width: 100%;
margin-top: 15px;
.submit-button:hover {
background-color: #ff5252;
</style>
</head>
<body>
<div class="welcome-container">
<h2>Welcome Back!</h2>
<label for="name">Name:</label>
<label for="age">Age:</label>
The code is a PHP script that handles a user login form. It validates user input (name, age, and role)
and connects to a MySQL database to verify user credentials. If successful, it initiates a session for
the user.
Key Components
1. Variable Initialization:
o Uses variables to hold error messages and user input ($name, $age, $role).
2. Database Connection:
o Connects to the MySQL database using mysqli and checks for connection errors.
o The script processes data upon form submission via a POST request.
o Name Validation: Checks if the name contains only letters using a regular
expression.
4. Credential Verification:
o If all validations pass, it checks the database for the user with the specified name
and age.
o If found, the user is welcomed and session variables are set. If not, it returns an
error.
5. HTML Form:
o An HTML form captures user data (name, age, role) and displays error messages if
validations fail.
6. Styled Output:
o Basic CSS styles are applied for better user experience and aesthetics in the web
interface.
Summary
This script effectively manages user input for login verification, including necessary validations and
interactions with a MySQL database, while providing a user-friendly interface.
SQL CODE FOR LOGIN
SOURCE CODE
name VARCHAR(50),
role VARCHAR(255)
);
OVERVIEW
1. CREATE TABLE users: This part of the command specifies that a new table called users will
be created in the database.
o PRIMARY KEY: This constraint ensures that each value in this column is unique and
cannot be NULL, providing a way to uniquely identify each row in the table.
3. name VARCHAR(50):
o VARCHAR(50): Indicates that the column can hold variable-length character strings,
with a maximum length of 50 characters.
o TINYINT(3): Specifies that the data type is a tiny integer, which can hold values from
0 to 255. The (3) indicates the display width but does not affect the range of values.
5. role VARCHAR(255):
o role: This column stores the user’s role (e.g., Parent, Teacher, Guardian).
Summary
This SQL command establishes a structured table called users, designed to effectively store and
manage user information, including a unique identifier (id), name, age, and role. Each entry in this
table represents an individual user within the database.
HOME PAGE
SOURCE CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dream Shelf</title>
<link rel="stylesheet" href="style-edited.css"> <!-- Link to the external CSS stylesheet -->
<style>
/* Basic Styles */
body {
color: white;
text-align: center;
position: relative;
overflow-x: hidden;
.shape {
position: absolute;
border-radius: 50%;
opacity: 0.6;
z-index: -1;
width: 150px;
height: 150px;
background-color: #f6d365;
top: 100px;
left: -50px;
.shape.shape2 {
width: 200px;
height: 200px;
background-color: #fda085;
top: 300px;
right: -70px;
.shape.shape3 {
width: 100px;
height: 100px;
background-color: #ff6f61;
bottom: 100px;
left: 50%;
transform: translateX(-50%);
.shape.shape4 {
width: 80px;
height: 80px;
background-color: #ff5252;
top: 500px;
left: 80px;
}
/* Header styling */
header {
padding: 20px;
border-radius: 15px;
margin-bottom: 30px;
header h1 {
font-size: 3rem;
color: #ff6f61;
header p {
font-size: 1.2rem;
color: #666;
margin-top: 5px;
/* Navigation Styling */
nav a {
color: #ff6f61;
text-decoration: none;
margin: 0 15px;
font-size: 1.2rem;
}
nav a:hover {
color: #ff1744;
/* Image styling */
.shelf-image {
display: block;
padding: 10px;
max-width: 80%;
height: auto;
border-radius: 20px;
.shelf-image:hover {
transform: scale(1.05);
/* Footer styling */
footer {
margin-top: 20px;
color: #666;
font-size: 1rem;
footer p {
margin: 5px;
</style>
</head>
<body>
<header>
</header>
<style>
/* Other styles */
nav a {
nav a:hover {
</style>
</head>
<body>
<nav>
</nav>
</body>
<p style="color: white; font-size: 1.5rem; margin-bottom: 20px;">Click on the image below to
register ↓</p>
<a href="http://localhost/loginn.php">
</a>
</section>
<p style="color: white; font-size: 1.5rem; margin-bottom: 20px;">Click on the image below to log
in ↓</p>
<a href="http://localhost/welcomeback.php">
<img class="shelf-image" src="shelf image 2.jpg" alt="Library Image" style="width: 80%; max-
width: 700px; height: auto; padding: 15px; border: 3px solid white; border-radius: 15px;">
</a>
</section>
<!-- Footer Section -->
<footer>
</footer>
</body>
</html>
2. Head Section:
o Meta Tags:
o Styles:
3. Body Section:
o Background Shapes: Contains four div elements that create decorative shapes
positioned absolutely in the background.
o Header: Introduces the site with a welcome message and slogans, styled for
prominence (e.g., text shadow, background).
o Navigation: A simple navigation link to the "About Us" page styled to change color
on hover.
Links: Includes navigation and action links that are easily identifiable and responsive.
Hover Effects: Provides visual feedback when users interact with elements (e.g., navigation
links and images).
ABOUT US
SOURCE CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<header>
</header>
<nav>
<a href="homepage.html">Home</a>
</nav>
<div class="about-container">
<h1>About Us</h1>
<p>Hello parents, teachers, and guardians! At Dream Shelf, we believe in fostering a love for
reading and lifelong learning for every child, especially those between the ages of <mark>6 and
12</mark>. Our mission is to empower young minds by providing access to engaging books,
educational audio logs, and creative activities that encourage curiosity, imagination, and
learning.!</p>
<p>We understand that every story is more than just words on a page—it's an opportunity
for children to experience diverse worlds, broaden their perspectives, and build a strong
foundation for their education. Whether it’s exploring the wonders of nature, learning valuable
life lessons through relatable characters, or exercising problem-solving skills with interactive
games, Dream Shelf is dedicated to offering content that enriches children’s lives.!📚✨</p>
<p>With Dream Shelf, every turn of the page opens up a new adventure. Join us and let's
unlock the magic of reading together! You'll never run out of fun stories to explore!</p>
<p>So grab your favorite book, and let your imagination fly! 🤩🌈</p>
</div>
<footer>
</footer>
</body>
</html>
OVERVIEW
The HTML document outlines the "About Us" page for "Dream Shelf." It begins with declarations
indicating the document is HTML5 and set in English. The <head> section includes metadata for
character encoding and responsiveness, a title for the page, and links to an external CSS file for
styling.
In the <body> section, a header welcomes visitors, presenting the site's mission as a source of
fun and educational content. The navigation panel features a link to the homepage. The main
content area contains an "About Us" section that addresses parents and educators, emphasizing
the organization's commitment to fostering a love for reading and learning among children aged
6 to 12. This section includes several paragraphs that detail the organization's goals, highlighting
the transformative power of stories and inviting community support.
Lastly, the footer presents copyright information for "Dream Shelf." Overall, the structure is
designed for user-friendliness, blending playful language with professional communication to
effectively convey the organization's values and offerings.
BOOKS PAGE
SOURCE CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Search Here</title>
<style>
.back-button {
text-align: center;
margin-bottom: 20px;
.back-button a {
text-decoration: none;
color: #ffffff;
background-color: #ff6f61;
border-radius: 30px;
display: inline-flex;
align-items: center;
font-size: 1.2rem;
.back-button a:hover {
background-color: #e65c52;
transform: scale(1.05); /* Slightly increase size on hover */
.back-button a:before {
</style>
</head>
<body>
<header>
<div class="back-button">
</div>
</header>
<div class="search-bar">
<button onclick="searchBooks()">Search</button>
</div>
</div>
<script>
const books = [
{ title: "Colors", author: "Salma Gull", category: "Literature", availableOffline: true, link:
"https://drive.google.com/file/d/1Zv_0KR_Ave3NmSbpolSKUU2g5F4BJMyP/view" },
{ title: "Alice's Adventures in Wonderland", author: "Lewis Carroll", category: "Fantasy",
availableOffline: false, link:
"https://drive.google.com/file/d/1979mV4ZLjeTDrYV3XzQnGikP9zkxeiVP/view" },
{ title: "Peter Pan", author: "J.M. Barrie", category: "Fantasy", availableOffline: true, link:
"books/peter_pan.html" },
];
function displayBooks(booksToDisplay) {
categoryElement.className = "category";
categoryElement.innerHTML = `<h2>${category}</h2>`;
bookList.appendChild(categoryElement);
books.forEach(book => {
bookElement.className = "book";
bookElement.innerHTML = `
<p>Author: ${book.author}</p>
`;
categoryElement.appendChild(bookElement);
});
function groupBooksByCategory(books) {
if (!grouped[category]) {
grouped[category] = [];
grouped[category].push(book);
return grouped;
}, {});
function searchBooks() {
displayBooks(filteredBooks);
function readText() {
synth.speak(utterThis);
window.addEventListener('load', () => {
displayBooks(books);
if (!navigator.onLine) {
});
</script>
</body>
</html>
OVERVIEW
Key Components:
1. Header: Displays the main title and a brief description of the website, along with a
navigation link back to the homepage.
2. Search Functionality: Includes an input field for users to type book titles or authors and a
search button that filters and displays matching results.
3. Dynamic Book List: Utilizes JavaScript to present a list of books, organized by category. Each
book entry includes the title, author, availability status, and a link to view the book.
4. Text-to-Speech Feature: Offers an option to read the book list aloud using the Web Speech
API, enhancing accessibility.
5. Responsive Design: Includes basic CSS for layout and styling, ensuring a visually appealing
interface that works well on different devices.
The webpage is designed to empower users, particularly children, by providing easy access to a
variety of books, both online and offline.
AUDIO LOGS
SOURCE CODE.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
/* Body styling */
body {
padding: 20px;
color: #333;
/* Header styling */
header {
text-align: center;
padding: 30px;
margin-bottom: 40px;
header h1 {
font-size: 3rem;
color: #ff6f61;
font-weight: bold;
margin-bottom: 10px;
.back-button {
text-align: center;
margin-bottom: 20px;
.back-button a {
text-decoration: none;
color: #ffffff;
background-color: #ff6f61;
border-radius: 30px;
display: inline-flex;
align-items: center;
font-size: 1.2rem;
}
.back-button a:hover {
background-color: #e65c52;
transform: translateY(-3px);
.category {
margin: 30px 0;
padding: 20px;
background: #ffffff;
border-radius: 10px;
.category h2 {
color: #ff6f61;
text-align: center;
margin-bottom: 20px;
font-size: 1.8rem;
font-weight: bold;
/* Story links */
.story {
margin: 10px 0;
text-align: center;
}
.story a {
display: inline-block;
color: #ffffff;
text-decoration: none;
border-radius: 30px;
font-size: 1.1rem;
.story a:nth-child(odd) {
background-color: #6db3f2;
.story a:nth-child(even) {
background-color: #ffab40;
.story a:hover {
background-color: #ff6f61;
transform: translateY(-3px);
/* Footer styling */
footer {
text-align: center;
margin-top: 50px;
color: #666;
font-size: 1rem;
font-weight: bold;
opacity: 0.9;
/* Keyframe animations */
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
@keyframes slideIn {
</style>
</head>
<body>
<header>
<div class="back-button">
</div>
</header>
<div class="category">
<h2>Literature</h2>
<div class="story">
</div>
<div class="story">
</div>
<div class="story">
</div>
<div class="story">
</div>
<div class="story">
</div>
</div>
<div class="category">
<h2>Fantasy</h2>
<div class="story">
</div>
<div class="story">
</div>
<div class="story">
</div>
<div class="story">
</div>
<div class="story">
<p><a href="audio/fantasy_story5.mp3" download>Story 5: Howl's Moving
Castle</a></p>
</div>
</div>
<div class="category">
<h2>Adventure</h2>
<div class="story">
</div>
<div class="story">
</div>
<div class="story">
</div>
<div class="story">
</div>
<div class="story">
</div>
</div>
<footer>
</footer>
</body>
</html>
1. Document Metadata:
o The document is set to use UTF-8 encoding and is optimized for responsive design
on various devices.
2. External Stylesheet:
o Global CSS rules reset margins and paddings and define a gradient background, font
styles, and layout designs for the elements like the header, categories, and story
links to enhance aesthetics and usability.
o Keyframe animations (fadeIn and slideIn) are defined to provide visual effects when
elements appear on the page.
4. Header Section:
o Contains the main title of the page, a descriptive subtitle, and a back button that
links to the homepage (mainpage.html).
5. Story Categories:
o Each category contains links to multiple audio stories, with hyperlinks enabling users
to download files directly. Each link is styled differently based on its placement
(odd/even).
6. Footer:
Features:
The design is responsive with a clean layout, utilizing colors that enhance readability.
The back button offers easy navigation, while the categorized list of audio stories provides
users with structured access to content.
The use of CSS animations aids in creating a more engaging user experience.
Overall, this HTML document serves as a well-organized platform for listening to and
downloading audio stories, targeting an audience interested in literature and audio content.
GAMES SECTION
SOURCE CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<header>
<div class="back-button">
<style>
.back-button {
text-align: center;
margin-bottom: 20px;
.back-button a {
text-decoration: none;
color: #ffffff;
background-color: #ff6f61;
display: inline-flex;
align-items: center;
font-size: 1.2rem;
.back-button a:hover {
background-color: #e65c52;
.back-button a:before {
</style>
</header>
<nav>
<a href="homepage.html">Home</a>
<a href="Books.html">Books</a>
<a href="Games.html">Games</a>
</nav>
<div class="games-container">
<h2>Educational Games</h2>
<div class="game">
<h3>Beginner Math</h3>
</div>
<div class="game">
</div>
<div class="game">
<h3>Think Game</h3>
</div>
<div class="game">
</div>
<div class="game">
</div>
<div class="game">
<p>Click the link below to explore this fun animal matching game!</p>
</div>
<div class="game">
</div>
</div>
<footer>
</footer>
</body>
</html>
1. Document Metadata:
o <!DOCTYPE html>: This declaration defines the document type and version of HTML,
ensuring that browsers render the page in standards mode.
o <head> Section:
2. Header Section:
o <h1> and <p>: These elements deliver a welcoming message and invite users to join
interactive experiences through education and entertainment.
o Back Button:
.back-button styles center the button and add margin for spacing.
The link (<a>) has no text decoration and is displayed as a flex item with
padding, rounded corners, and a background color, enhancing its visual
appeal.
A hover effect (:hover) changes the background color and slightly scales the
button, providing interactive feedback.
A left-pointing arrow is added before the text using the :before pseudo-
element.
3. Navigation Panel:
o <nav>: Contains navigation links that direct users to other sections of the site. This
enhances user experience by allowing quick access to important areas.
o Each <a> element represents a link to different pages (Home, Books, Audio Logs,
Games), using intuitive text for clarity.
4. Games Container:
o Embedded Games:
Some games, like Tic Tac Toe and Sudoku, offer downloadable or external
links, allowing for offline engagement (compatible with Windows).
5. Footer:
Design Considerations:
The layout uses semantic HTML elements (header, nav, main, footer) that enhance the
structure and readability of the document, improving accessibility for screen readers and
search engines.
CSS styles applied to buttons and interactive elements create a friendly and engaging user
experience, essential for educational platforms aimed at younger audiences or learners.
Overall, this webpage design encourages exploration and learning through its interactive
components, ensuring an enjoyable user experience while maintaining a clear structure and
purpose.
KEY SCENARIOS FOR INTEGRATION TESTING
1. User Registration process
2. User login process
3. Access to Home page
4. Functionality of navigation bar
5. Search panel for books
6. Are the games playable
7. What requirements are needed for the software and hardware.
TESTING METHODOLOGY
REGISTRATION PAGE
Unit Testing
Tools: Frameworks like Jest, Mocha (for JavaScript), JUnit (for Java), PHPUnit (for PHP), etc.
Approach:
o Verify that input validation functions (like checking email formats) behave correctly.
o Confirm that data transformation functions (e.g., hashing passwords) yield expected
results.
2. Integration Testing
Approach:
o Test the registration endpoint to ensure that it can receive data, process it, and return
the correct response.
o Check interactions between the user input, the validation logic, and the database.
3. Functional Testing
Purpose: Verify that the user registration feature meets functional requirements.
Approach:
o Automate tests that simulate user registration scenarios (e.g., filling out the form,
submitting, and checking success messages).
o Test with various invalid inputs (e.g., missing fields, invalid email formats) and validate
appropriate error messages.
o Check that fields expecting unique values (like email addresses) are handled correctly.
4. Usability Testing
Approach:
o Gather feedback on the registration form's layout, clarity of instructions, and ease of
use.
5. Security Testing
Approach:
Cross-Site Scripting (XSS): Validate that user inputs are sanitized to prevent
script injection.
Password security: Ensure that passwords are stored securely (e.g., hashed)
and that user password policies are enforced (e.g., complexity requirements).
Brute Force Protection: Test for mechanisms that limit the number of
registration attempts.
6. Performance Testing
Purpose: Ensure the registration system performs well under various loads.
Approach:
o Conduct load testing to see how the application performs under high traffic conditions
(many users attempting to register simultaneously).
o Check response times for registration requests and ensure they are within acceptable
limits.
7. Regression Testing
Purpose: Verify that new changes or bug fixes do not negatively impact existing functionality.
Approach:
o Rerun previous tests (unit, integration, functional) whenever changes are made to the
registration code to confirm that everything still works as expected.
8. End-to-End Testing
Purpose: Validate the entire user registration flow from start to finish.
USER LOGIN
Introduction
The login page is a critical component of any web application, serving as the gateway for users to
access their accounts. Ensuring its functionality, security, and user experience is paramount. This
report outlines a comprehensive testing methodology designed to validate the login page code,
encompassing various types of testing to ensure robustness and reliability.
2. Objectives
Scope:
Tools:
Approach:
Purpose: To ensure that different parts of the login mechanism work together correctly.
Scope:
o Validate the interaction between the login form, validation logic, and backend
services.
o Verify that valid user credentials successfully authenticate and return the correct user
session.
Tools:
Approach:
o Test the login API endpoints with valid and invalid credentials.
o Confirm that sessions are managed properly and necessary cookies are sent.
Purpose: To ensure all functional requirements of the login page are met.
Scope:
o Test all user flows related to the login process, including logging in, forgotten
password, and user feedback (error/success messages).
Tools:
Approach:
o Simulate user interactions with the login form, inputting various credentials to
validate success and error cases.
o Verify that all functionalities meet specified requirements, including redirects after
successful login and appropriate error handling.
Scope:
Approach:
o Recruit real users to navigate the login page, gathering feedback on usability.
o Use techniques like A/B testing to optimize the interface based on user interactions.
Scope:
o Test for common vulnerabilities such as SQL Injection, Cross-Site Scripting (XSS), and
Brute Force attacks.
Tools:
Approach:
o Ensure adherence to best practices in password security (e.g., hashing and salting)
and session management.
Purpose: To assess the responsiveness and stability of the login system under various conditions.
Scope:
o Evaluate load handling capabilities and response times during high traffic.
Tools:
Approach:
Purpose: To ensure that recent changes do not negatively impact existing functionality.
Scope:
Approach:
o Maintain a suite of automated tests that run after every deployment to flag any
regressions in the login functionality.
Purpose: To ensure that the login page functions correctly across different browsers and devices.
Scope:
o Test compatibility with major browsers (Chrome, Firefox, Safari, Edge) and various
devices (desktop, tablet, mobile).
Approach:
o Verify that the responsive design functions appropriately on different screen sizes.
INTEGRATION TESTING TOOLS
PHPUnit
Use Cases: Suitable for unit testing, it also supports integration tests, especially using its
TestCase structure to perform database interactions and check business logic.
Laravel Dusk
Use Cases: Provides end-to-end testing functionalities in a browser, allowing for integration
tests that verify how the application behaves with the UI and backend together.
Selenium WebDriver
Description: A tool for automating web browsers, it supports various programming languages,
including tests written in PHP using bindings.
Use Cases: Ideal for browser-based integration tests between HTML, JavaScript, and PHP web
applications, validating that all components interact correctly.