-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
46 lines (46 loc) · 1.36 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php include('server.php'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>To Do List in Php</title>
</head>
<body>
<?php if (isset($_SESSION['message'])): ?>
<div class="msg">
<?php
echo $_SESSION['message'];
unset($_SESSION['message']);
?>
</div>
<?php endif ?>
<div class="container">
<h1>To Do List App</h1>
<form action="server.php" method="post">
<input type="text" name="task" size="30" placeholder="Enter your task">
<button type="submit" id="add-btn" name="add-btn" value="Add">Add</button>
</form>
<?php $results = mysqli_query($conn, "SELECT * FROM tasks"); ?>
<table>
<thead>
<tr>
<td>ID</td>
<td>Tasks</td>
</tr>
</thead>
<?php while ($row = mysqli_fetch_array($results)) { ?>
<tr>
<td><?php echo $row['id']?></td>
<td><?php echo $row['task']?></td>
<td>
<a href="server.php?del=<?php echo $row['id']; ?>" class="del_btn">Delete</a>
</td>
</tr>
<?php } ?>
</table>
</div>
</body>
</html>