This is a work in progress! I’m writing this book out in the open. It’s messy, unedited, and extemely unfinished. You’re welcome to take a look, and if you have any feedback I’d love to hear from you.
PHP is for people.
Anyone can build fun and useful things with PHP. You don’t have to have a computer science degree or be some kind of coding genius to use it. Programming with PHP is much like playing a game; once you learn the controls and rules, you can have a ton of fun with it!
This book will teach you everything you need to make an actual functioning thing with PHP (and will walk you through building that thing, step by step). It’ll mainly stick to the basics, because that’s all you really need. It won’t get into frameworks or databases, because you don’t need them. All you need is a little curiosity and patience.
Who wrote this, anyway? I’m Adam Newbold, the guy who runs Neatnik and omg.lol. I’ve been using PHP to build fun stuff for the web for a quarter century. Yeah, I know, I’m an internet boomer.
The book is organized into chapters, and you’re welcome to skip around. You can explore the list of chapters below, or jump right in.
Chapter 1: Introduction
The briefest possible PHP history lesson, and some notes about coding norms.
Chapter 2: Setup & testing
Get your enviornment ready to run PHP.
Key concepts: PHP tags (<?php ?>) and the echo function
Chapter 3: HTTP 101
What do we do with data? We GET and POST it!
Key concepts: HTTP methods, variables, and arrays
Chapter 4: Guestbook.php
We’re gonna build a guestbook!
Key concepts: Code structure, mixing PHP/HTML, and form submission behavior
Chapter 5: Make an entry
It’s time to make our first guestbook entry.
Key concepts: Conditional logic, form validation, input sanitization, file_put_contents(), file-related security
Chapter 6: Show it off
Now we can display our guestbook entries.
Key concepts: file_get_contents(), loops
Chapter 7: What’s next?
The sky is the limit!