aboutsummaryrefslogtreecommitdiff
path: root/guestbook
diff options
context:
space:
mode:
authorFrankie B <git@diskfloppy.me>2023-06-13 21:59:16 +0100
committerFrankie B <frankieraybrown@gmail.com>2023-06-14 22:15:44 +0100
commita464ef4c0e3ce235fb1da70dfb282449beeeac80 (patch)
tree4708f5c996376dd94f2cc49f7d16dc80eef1a4df /guestbook
parent44db6ce1d9cfdca7e175cb74ee7d818b94571bc4 (diff)
Initialize laravel app
Diffstat (limited to 'guestbook')
-rwxr-xr-xguestbook/index.php75
1 files changed, 0 insertions, 75 deletions
diff --git a/guestbook/index.php b/guestbook/index.php
deleted file mode 100755
index 1bd827d..0000000
--- a/guestbook/index.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php $db = new PDO("sqlite:/srv/guestbook.db"); ?>
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <!-- Global -->
- <?php require('../inc/header.inc.php'); ?>
-
- <!-- Page-specific -->
- <?php require_once('../inc/title.inc.php') ?>
- <link rel="shortcut icon" href="../res/img/icons/ico/help-book.ico" type="image/x-icon">
- <meta property="og:title" content="Guestbook">
- <meta property="og:description" content="h">
- <meta property="og:image" content="/res/img/icons/png/help-book.png">
-</head>
-<body>
-<div class="page">
-<?php require('../inc/nav.inc.php') ?>
-
-<div id="pagebody">
- <div id="content">
- <br>
- <form action="submit.php" method="post">
- <fieldset>
- <legend>Add Entry</legend>
- <table class="form">
- <tr>
- <td class="form"><i>Form temporarily disabled</i></td>
- </tr>
- </table>
- </fieldset>
- </form>
-
- <?php
- // Pain
- $count_query = $db->prepare('SELECT COUNT(*) FROM Entries');
- $count_query->execute();
- $count = $count_query->fetch()[0];
- echo '<h1>Entries <small>(' . $count . ' total)</small></h1>';
- // Prepare SELECT statement.
- $select = "SELECT name, message, show_info, show_ip, ip, submitted, browser_info FROM Entries ORDER BY submitted DESC";
- $stmt = $db->prepare($select);
-
- // Execute statement.
- $stmt->execute(); // ID between 1 and 3.
-
- // Get the results.
- $results = $stmt->fetchAll(PDO::FETCH_ASSOC);
-
- foreach($results as $row) {
- echo '<table border="1" width="500"><tr><td><pre>';
- $submittedRaw = $row['submitted'];
- $submittedDT = new DateTime("@$submittedRaw");
- $submitted = $submittedDT->format('H:i:s - Y-m-d');
-
- $browser = get_browser(null, true);
- $sys = $browser['parent'] . ' (' . $browser['platform_description'] . ' ' . $browser['platform_version'] . ')';
-
- echo 'Name: ' . $row['name'] . PHP_EOL;
- if ($row['show_ip']) echo 'IP: ' . $row['ip'] . PHP_EOL;
- if ($row['show_info']) echo 'Sys: ' . $row['browser_info'] . PHP_EOL;
- echo 'Date: ' . $submitted . PHP_EOL . PHP_EOL;
- echo $row['message'];
- echo '</pre></td></tr></table><br>';
- }
- ?>
-
- </div> <!-- content -->
-
- <div id="footer" class="pagefooter">
- <?php $file = __FILE__;require('../inc/footer.inc.php'); ?>
- </div> <!-- footer -->
-</div> <!-- pagebody -->
-</div> <!-- page -->
-</body>
-</html>