0% found this document useful (0 votes)
23 views4 pages

PHP ToDo List Report

The PHP Simple To-Do List project is a web application that allows users to manage tasks using PHP, MySQL, and HTML5, demonstrating basic CRUD operations. It includes features for adding, viewing, and deleting tasks through a user-friendly interface. The project can be further enhanced with additional functionalities like user authentication and task management features.

Uploaded by

nishika235p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views4 pages

PHP ToDo List Report

The PHP Simple To-Do List project is a web application that allows users to manage tasks using PHP, MySQL, and HTML5, demonstrating basic CRUD operations. It includes features for adding, viewing, and deleting tasks through a user-friendly interface. The project can be further enhanced with additional functionalities like user authentication and task management features.

Uploaded by

nishika235p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

PHP Simple To-Do List Project Report

ABSTRACT

This project presents a simple yet effective To-Do List application developed using PHP and HTML5. It

demonstrates basic CRUD operations and serves as a fundamental example of PHP-MySQL web integration.

OBJECTIVE

The primary objective of this project is to develop a task management tool that allows users to add, view, and

delete to-do items through a web interface, using PHP for back-end logic and MySQL for data storage.

INTRODUCTION

To-Do Lists are simple yet powerful tools for organizing daily tasks. This project demonstrates how such an

application can be built using PHP, a popular server-side scripting language, along with MySQL and HTML5.

METHODOLOGY

1. Tools Used:

- PHP: For backend scripting.

- MySQL: To store tasks.

- HTML5: To design the user interface.

- CSS: For basic styling.

2. Process:

- Setup local server using XAMPP.

- Create MySQL database 'todo_app' with table 'todos'.

- Build PHP scripts for adding, retrieving, and deleting tasks.

- Integrate everything in a web interface using HTML and CSS.


PHP Simple To-Do List Project Report

CONCLUSION

The PHP Simple To-Do List project effectively demonstrates basic web development concepts. It can be

expanded with user authentication, task priorities, and deadlines in the future.

CODE

db.php
<?php
$servername = "localhost";
$username = "root";
$password = "";
$database = "todo_app";

$conn = mysqli_connect($servername, $username, $password, $database);

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>
<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>
PHP Simple To-Do List Project Report

</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;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
PHP Simple To-Do List Project Report

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;
}

You might also like