maybecoding

Hello htmlspecialchars my old friend

For the past week or so I've been working on a new app. A tiny app, to scratch a personal itch - as usual.

The app is an experimental translation tool (more details in a future post) with a super basic flow: enter a query -> press a button -> get a response. And I'm using JavaScript for the frontend logic, because… I suppose because it's become a habit at this point.

Then yesterday I read this comment on Hacker News and felt ever so slightly ashamed! I'm already generating the full response on the server and streaming it to the frontend, so there's no reason for my app to be literally unusable without JavaScript!

That changes today 🙂

I'm going back to basics and making sure that my app works without JavaScript first. Then I'll add JS to make the UX a bit nicer.

It's been a LONG time since I've generated HTML on a server. But my app is so tiny, a framework really isn't necessary here. All I need is PHP and the venerable htmlspecialchars function. Let's do this!