From 38f9f9e6f20907e0abb79f9e7fb50394c7561e45 Mon Sep 17 00:00:00 2001 From: "Evan G." Date: Sun, 21 Apr 2024 17:58:09 -0500 Subject: [PATCH] Implement Guestbook Display + Mobile Display --- guestbook/index.html | 30 +++++++++++++++++++++++++++++- guestbook/submit.php | 26 +++++++++++++++++--------- homepage.css | 43 +++++++++++++++++++++---------------------- index.html | 8 +++++++- post1.html | 1 + readable.css | 1 - 6 files changed, 75 insertions(+), 34 deletions(-) diff --git a/guestbook/index.html b/guestbook/index.html index 38025ad..17ab7bd 100644 --- a/guestbook/index.html +++ b/guestbook/index.html @@ -4,14 +4,42 @@ My Cool Guestbook! + + - This is a guestbook, made by fbievan +
+

Guestbook

+

This is a guestbook, made by fbievan

+
+ +
+ "; + foreach($data as $post) { + echo '
'; + echo "

"; + echo $post["name"] . "
"; + echo "

"; + echo "

"; + echo $post["message"] . "
"; + echo "

"; + echo "
"; + } + echo ""; + ?> +
+ diff --git a/guestbook/submit.php b/guestbook/submit.php index 9352661..2f72818 100644 --- a/guestbook/submit.php +++ b/guestbook/submit.php @@ -1,23 +1,31 @@ $fname, "message" => $fmsg); -# Show Array -echo json_encode($savemsg); + # Setup JSON -$data = json_decode(file_get_contents('test.json', true)); +$data = json_decode(file_get_contents('test.json'), true); + # Add array_unshift($data , $savemsg); -var_dump($data); +# Check name and message +if ($fname == "") { + echo "There is no name, Try again with a name"; + exit(); +} +if ($fmsg == "") { + echo "There is no message, Try again with a message"; + exit(); +} file_put_contents('test.json', json_encode($data, JSON_PRETTY_PRINT)); + +echo $fmsg; + diff --git a/homepage.css b/homepage.css index 9f21392..e2ceb7c 100644 --- a/homepage.css +++ b/homepage.css @@ -1,24 +1,23 @@ -.articles { - padding: 5px; - border: var(--line-width) solid; - border-top-style: dashed; - border-bottom-style: dashed; - border-right-style: none; - border-left-style: none; -} - section { + .articles { + padding: 5px; border: var(--line-width) solid; - border-left-style: none; + border-top-style: dashed; + border-bottom-style: dashed; border-right-style: none; - border-top-style: none; - text-align: left; - padding-bottom: 20px; - padding-top: 0px; -} -h3 { - text-align: left; - font-size: 1.4rem; - margin-top: 10px; - padding-top: 0px; -} - + border-left-style: none; + } + section { + border: var(--line-width) solid; + border-left-style: none; + border-right-style: none; + border-top-style: none; + text-align: left; + padding-bottom: 20px; + padding-top: 0px; + } + h3 { + text-align: left; + margin-top: 10px; + padding-top: 0px; + } + diff --git a/index.html b/index.html index d70cd45..81138a4 100644 --- a/index.html +++ b/index.html @@ -3,8 +3,9 @@ - + +

Fbi's Epic Blog

+ +
+

thank

+
+ diff --git a/post1.html b/post1.html index dc85602..7a4ae73 100644 --- a/post1.html +++ b/post1.html @@ -4,6 +4,7 @@ My First Post - Fbi's Epic Blog +