Full PHP ToDo List Report
Full PHP ToDo List Report
ABSTRACT
This project demonstrates a web-based To-Do List application using PHP and HTML5. It enables users to
manage their daily tasks effectively. By leveraging MySQL for storage, and HTML5/CSS for the front-end,
this simple application lays a strong foundation for beginner-level full-stack development using the LAMP
stack.
OBJECTIVE
To design and implement a basic task-listing web application that performs Create, Read, and Delete
operations using PHP. The project aims to solidify understanding of server-side scripting, form handling,
INTRODUCTION
Task management systems are widely used in productivity applications. This project focuses on implementing
one such system using PHP. We use procedural PHP along with MySQL to build a lightweight but functional
To-Do list app. The goal is not only to build an app but to understand how the components interact.
METHODOLOGY
Tools Used:
Steps Followed:
PHP Simple To-Do List Project Report
2. Build the main interface with a form to add tasks and list to display them.
3. Create PHP scripts for adding and deleting tasks using POST and GET methods.
CODE
db.php
<?php
$servername = "localhost";
$username = "root";
$password = "";
$database = "todo_app";
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
?>
index.php
<?php
include("db.php");
$result = mysqli_query($conn, "SELECT * FROM todos ORDER BY id DESC");
?>
<!DOCTYPE html>
<html>
<head>
<title>Simple To-Do List</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container">
<h1>To-Do List</h1>
<form method="POST" action="add.php">
<input type="text" name="task" required placeholder="Add new task">
<button type="submit">Add</button>
</form>
PHP Simple To-Do List Project Report
<ul>
<?php while ($row = mysqli_fetch_assoc($result)) { ?>
<li>
<?php echo htmlspecialchars($row['task']); ?>
<a href="delete.php?id=<?php echo $row['id']; ?>">Delete</a>
</li>
<?php } ?>
</ul>
</div>
</body>
</html>
add.php
<?php
include("db.php");
if (isset($_POST['task'])) {
$task = mysqli_real_escape_string($conn, $_POST['task']);
mysqli_query($conn, "INSERT INTO todos (task) VALUES ('$task')");
}
header("Location: index.php");
exit();
?>
delete.php
<?php
include("db.php");
if (isset($_GET['id'])) {
$id = (int)$_GET['id'];
mysqli_query($conn, "DELETE FROM todos WHERE id = $id");
}
header("Location: index.php");
exit();
?>
css/style.css
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
padding: 20px;
}
.container {
max-width: 500px;
margin: auto;
background: white;
PHP Simple To-Do List Project Report
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
input[type=text] {
padding: 10px;
width: 70%;
margin-right: 10px;
}
button {
padding: 10px 20px;
}
ul {
list-style-type: none;
padding: 0;
}
li {
margin: 10px 0;
display: flex;
justify-content: space-between;
}
SCREENSHOTS
PHP Simple To-Do List Project Report
PHP Simple To-Do List Project Report
PHP Simple To-Do List Project Report
CONCLUSION
This project successfully demonstrates the integration of PHP with MySQL to build a dynamic,
database-driven application.
It not only serves as an academic project but also as a practical guide to implementing real-world logic in web
applications.
Key Learnings:
Future Scope:
This application lays the groundwork for more advanced full-stack projects.