2024-04-19 22:13:16 -05:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
2024-05-19 12:06:49 -05:00
|
|
|
<title>My Cool Guestbook!</title>
|
2024-05-20 10:51:59 -05:00
|
|
|
<link rel="stylesheet" href="/css/readable.min.css"</link>
|
2024-05-19 12:06:49 -05:00
|
|
|
<link rel="stylesheet" href="./guestbook.css"</link>
|
2024-04-21 17:58:09 -05:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2024-04-19 22:13:16 -05:00
|
|
|
</head>
|
|
|
|
<body>
|
2024-05-19 12:06:49 -05:00
|
|
|
<header>
|
|
|
|
<h1>Guestbook</h1>
|
|
|
|
<p>This is a guestbook, made by fbievan</p>
|
|
|
|
</header>
|
|
|
|
<nav>
|
|
|
|
<a href="../index.html">Back Home</a>
|
|
|
|
</nav>
|
|
|
|
<main>
|
Add comments & Update URL Sceheme
This adds many comments to submit-sql.php file (previously restore.php), and renames the file, this is the start of this, and thus pulling from the SQL database is not yet supported. I also do not have checking for duplicates, but I feel like that could be done in-database. This is currently using a development SQLite database, and will eventually use postgresql. I need to find out a way to obscure credentials to PostgreSQL, maybe loading it from a ignored file, which would be git ignored? The SQL Implmentation is not production-ready, and also I need to figure out a better solution when switching from JSON TO SQL, as I plan to support both in this project. There needs to be alot of refactoring done in the submisson code, as this is just a *really* early draft.
2024-06-09 15:39:05 -05:00
|
|
|
<form action="./submit-sql.php" method="post">
|
2024-05-19 12:06:49 -05:00
|
|
|
<input type="text" name="fname" placeholder="name"></input>
|
|
|
|
<input type="text" name="fmessage" placeholder="Message"></input>
|
|
|
|
<input type="submit"></input>
|
|
|
|
</form>
|
|
|
|
<?php
|
|
|
|
$data = json_decode(file_get_contents('test.json'), true);
|
|
|
|
echo "<div>";
|
|
|
|
foreach($data as $post) {
|
|
|
|
echo '<section class="guestbookpost">';
|
|
|
|
echo "<h4>";
|
|
|
|
echo $post["name"] . "<br>";
|
|
|
|
echo "</h4>";
|
|
|
|
echo '<h4 class="date">';
|
|
|
|
echo $post["date"] . "<br>";
|
|
|
|
echo "</h4>";
|
|
|
|
echo "<p>";
|
|
|
|
echo $post["message"] . "<br>";
|
|
|
|
echo "</p>";
|
|
|
|
echo "</section>";
|
|
|
|
}
|
|
|
|
echo "</div>";
|
|
|
|
|
|
|
|
?>
|
2024-04-21 17:58:09 -05:00
|
|
|
</main>
|
2024-05-19 12:06:49 -05:00
|
|
|
<footer>
|
|
|
|
I'm cool
|
|
|
|
</footer>
|
2024-04-19 22:13:16 -05:00
|
|
|
</body>
|
|
|
|
</html>
|