New PHP Tutorial
I’ve just uploaded a new version of my PHP tutorial. There are two major changes:
- I’ve converted all curly brackets (braces) to IF/ENDIF, WHILE/ENDWHILE, and FOREACH/ENDFOREACH. I’ve found this much easier for beginners to follow, especially in a web page where the ending of a block may be sitting on its own hidden in a bunch of HTML. I’ve added a section at the end discussing how to recognize curly brackets in other people’s code that they might see.
- I’ve replaced the ad-hoc MySQL section with a simple tutorial that follows seamlessly from the simple imaginary poll.
PHP for Dynamic Web Pages is available under the GNU Free Documentation License. If you have any comments, let me know.
- PHP: Hot Pages
- Basic PHP to store form data and maintain sessions.
- Internet and Programming Tutorials
- Internet and Programming Tutorials ranging from HTML, Javascript, and AppleScript, to Evaluating Information on the Net and Writing Non-Gendered Instructions.
More PHP
- Auto-closing HTML tags in comments
- One of the biggest problems on blogs is that comments often get stuck with unclosed italics, bold, or links. You can automatically close them by transforming the HTML snippet into an XML document.
- Stable sorting of numerically indexed arrays in PHP
- From PHP 4.1, sorted arrays are no longer “stable”. That is, if they are resorted and two items are equal values, they no longer can be expected to maintain their order vis-a-vis each other.
- Override the Host: header when using PHP’s readfile
- It is possible to specify HTTP headers when using URLs with PHP’s file-oriented functions such as readfile.
- Add nodes to SimpleXMLElement
- If you want to add child nodes in PHP’s SimpleXML, the correct way to do it is to add the node first, then create it.
- Web display of Taskpaper file
- It is easy to use PHP to convert a Taskpaper task file into simple HTML conducive to styling via CSS.
- Two more pages with the topic PHP, and other related pages