-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.php
More file actions
72 lines (56 loc) · 1.55 KB
/
Copy pathmain.php
File metadata and controls
72 lines (56 loc) · 1.55 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
session_start();
include("notedata.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Notes</title>
<link rel="stylesheet" href="Styles/style.css">
</head>
<body>
<?php
include('header.php');
?>
<a href="noteForm.php" class="add-button"> Add Note</a>
<div class="container">
<?php
if (!isset($noteconn)) {
die("Database connection not established.");
}
$sql = "SELECT * FROM note_data;";
$data = mysqli_query($noteconn, $sql);
if ($row = mysqli_fetch_assoc($data)) {
do {
?>
<div class="note">
<p class="Title"><?php echo htmlspecialchars($row["Title"]); ?></p>
<p class="Body"><?php echo htmlspecialchars($row["Body"]); ?></p>
<div class="buttons">
<a href="updateform.php?id=<?php echo $row['ID'] ?>">Edit</a>
<a href="delete.php?id=<?php echo $row['ID'] ?>">Delete</a>
</div>
</div>
<?php
} while ($row = mysqli_fetch_assoc($data));
}
if (isset($_GET["msg"])) {
$msg = $_GET["msg"];
echo "<p class='msg'>$msg</p>";
}
?>
</div>
<script src=" handler.js"></script>
<?php
include('footer.php');
?>
</body>
</html>
<?php
if ($_SESSION["username"]) {
} else {
header("location: index.php");
}
?>