Dan Q's PHP Cookery Class

An intro to PHP for Web Revivalists

Welcome to Dan Q's PHP Cookery Class

Long ago, it was commonplace for personal websites to be mildly dynamic. Most of their content would be static HTML, but it'd be ✨enhanced✨ with a sprinkle of server-side code (often written in PHP, or sometimes Perl).

Where personal websites exist today, they often fall into the extreme ends of the scale. They're either completely static - often from a static site generator like Jekyll - or else powered by a heavyweight CMS system like WordPress.

I think that's a shame, so I wrote this "cookery class" to teach fellow Web Revivalists how to write PHP code on their own websites; to add a bit of dynamic magic and unlock a world of creative possibilities.

If you're ready to get started, use the navigation bar to start with the introduction, where we'll check that you've got everything you need to start writing PHP code, and get a basic understanding of how PHP works before we move on to cook our first dish!

Philosophy of the Class

This is not a recipe book. A recipe would be like "How to make a Guestbook". You'll find recipes here, and you can follow them if you like, but the real purpose of this class is to teach you how to make your own recipes.

Learning a programming language like PHP is harder than just copy-pasting code from a recipe, but it's worthwhile because when you're done you'll be able to modify other people's recipes, to invent your own dishes, and to continue your learning journey.

There are lots of guides to learning PHP, but this one comes specifically from the focus of Web Revivalism. The examples it gives are all geared towards building and enhancing a personal website as you migrate from a completely static HTML site to a "mildly dynamic" PHP-powered one.

This site itself is written in PHP. I've made the full source code available: you can view the source code of any file right here, or you can browse the GitHub repository. All the code is released into the public domain, so you're free to use it for your own projects and you don't have to give credit.

About the Author

I'm Dan Q. I've been developing for the Web since the mid-1990s, and writing "mildly dynamic" sites since about the the same time. My first "mildly dynamic" features were contact forms and hit counters implemented in Perl, but the turn of the millenium I'd moved on to PHP. My career has taken me in and out of writing PHP daily, but it always holds a special place in my heart for its gentle learning curve and the simplicity of starting a new project.