Write Posyandu Cempaka's first PHP page: server, tags, semicolons, clock, forms and errors. 16 levels, played right in the browser with nothing to install.
For three years the health post's page was one HTML file: opened from anywhere, it said the same thing. A PHP file is different. PHP on the server runs its code first, and only the result is sent to the browser. In this game every villager's request really runs on PHP 8.4.23, and the page you see is what the Chromium browser received.
The browser never sees the server's folder. It asks for one address, and the server decides from the file's name: send this file as it is, or have PHP run it first?
In a .php file, HTML and PHP can take turns. Whatever is outside the tags is sent as it is; whatever is inside is run.
; closes one command. Forget it, and PHP thinks the command carries on into the next line.
PHP has two ways to tell you about a mistake: write it into the page, or note it in a log file. Both are set in php.ini, and every computer has its own php.ini.
Values from an address or a form always arrive as text. PHP turns them into numbers only when it is asked to do maths.