BSc
CatSScript Website
A cat-themed site for learning HTML, CSS and JavaScript, with a timed quiz per topic, built with a classmate for a BSc exam, and ported to a second database when the free host turned out not to run PostgreSQL.
Built with a classmate for a BSc web-programming exam: fifteen lesson pages covering HTML, CSS and JavaScript, and three ten-question quizzes with a fifteen-second timer, wrapped in kitten artwork with lobby music and podium sounds. The name is a pun on CSS and JavaScript.
- Context
- BSc exam project, spring 2021, with a classmate
- Contents
- 15 lessons · 3 quizzes × 10 questions · 15-second timer
- Stack
- PHP sessions · jQuery · Bootstrap · PostgreSQL and MySQL
- Repository
- VincenzoImp/catsscript-website
What it was
There is no framework and no router: the directory layout is the routing, and each section carries its own copy of the navigation bar and its own logout script. Accounts are PHP sessions over a users table.
The part worth keeping is the folder named varianti server. The site was written against a
local PostgreSQL, and the free host they could actually deploy to only offered MySQL, so the
repository ends up with two complete sets of authentication scripts, one per database, and a
commit message explaining that the two servers needed different kinds of query.
What I took from it
Comparing those two variants years later is more instructive than anything in the lessons. The PostgreSQL version uses bound parameters. The MySQL port interpolates the user’s input straight into the query string. The port is functionally identical and quietly injectable, and nobody noticed, because the thing you check after a migration is whether it still works, and it did.
That is the lesson: a port preserves behaviour and silently drops properties, and the properties are the part nobody has a test for.