Using all we have learned so far in PHP we're going to create a classic 90's guestbook.
We're storing the messages on our local machine. And we're doing it all in 1 day!
- Consolidate what we've learned so far
- Store data in files
- Convert arrays/objects to string representation
- Stick to a strict deadline!
Description | |
---|---|
Running Ubuntu 20.04 | |
Working with PHPStorm as IDE | |
Main language used is PHP | |
Using git for version control | |
Hosting my files on github |
- Day 1 (:date:03/11/2021)
- assignment was given at 9AM with short briefing and Q&A by coach Tim
- created the
challenge-php-guestbook
repository on gitHub andgit clone
to local device - read through the readme to understand the mission objective
- created this readme for an overview of the exercise and to keep track of progress
- what got done so far:
- created file structure ✔️
- created .gitignore to ignore .idea folder ✔️
- created index.php file ✔️
- first commit and push of the project at 🕘 09:30AM ✔️
- created form with title, message and name fields ✔️
- create new Post with title, message, name, date and timestamp ✔️
- seperated view from php ✔️
- seperated header, footer and body ✔️
- ❗ having trouble saving the messages to a file and then getting the file contents in a readable format
- after Lunch, I asked for help from our coach Tim to understand the way json_encode structured the data in the messages.json file
- I can now
put
andget
data frommessage.json
✔️ - I'm showing the messages with the latest message at the top ✔️
- Finally, got the messages to show where I want them, had to move the
require "body.html";
✔️ - had trouble showing the messages up to date after new post submission, something strange was happening when checking the 'isset($_POST)' it now works!!:heavy_check_mark:
- added a layer of protection by putting all the user input through a
protect()
method which uses thehtmlspecialchars()
✔️ - I should now have the core functionalities in there ✔️
- ❗ although there is still something strange with the first message to be posted after emptying out the json file.
- 🎉 Done with the must-haves
- 🕔 5PM end of the day, ran out of time for extras
- Day 2 (:date:04/11/2021)
- We got the happy news that our deadline was extended by a day!
- Those of us that got the must-haves done yesterday are now helping our fellow learners in small teams of 4
- In between helping I'm working on the nice to haves
- Done today:
- profanity filter should now work without case sensitivity ✔️
- I had to combine the profanity filter and the defacement protection into one method and filter out profanities before filtering out bad intent code ✔️
- the defacement check still shows the written code as is, just in case someone wants to share a code snippet this will still allow it without running the actual code
- Now featuring smileys! ✔️
- The user can now select the number of posts they want to have displayed ✔️
- I also added error messages when either input field is left empty ✔️
- Done today:
- 🎉 **done with the extras now! 🎉
- final push of the project at 🕒 14:45
This to do list is for my personal use, the full to do list is added at the start of the challenge and as I complete
objectives they will be moved up into the timeline section and ticked off using either emotes such as ✔️
or the checkbox
syntax [ ] [x] provided by markdown.
❗ Separate the footer and header HTML code and require()
them in your template files to avoid code repetition ✔️
- Posts must contain at least a Title, Date, Content, Author name ✔️
- At least 2 classes: PostLoader & Post ✔️
- Sort messages from new to old (most recent on top) ✔️
- Handle possible site defacement attacks using
htmlspecialchars()
✔️ - Only show the 20 latest posts ✔️
- Add a profanity filter (array with "bad" words) ✔️
- Replace typed smileys with their image counterpart ✔️
- Allow the user to pick how many messages he wants to see displayed ✔️