Chris asked:
So where is this <?php syntax defined? Is it part of HTML, is it a bodge added by apache or what is it? That's really what I was asking, I (sort of) know the difference between server side and client side stuff (I think I did even say something about <SCRIPT> being client side) and <SCRIPT> is at least 'proper' HTML.
It's defined in the PHP specification, so it must be implemented by any PHP enabled server (be that Apache, IIS, Lighttpd, etc.), and since it never reaches the browser it's not part of the 'proper' HTML or subject to that specification. Here's the manual ref:
http://www.php.net/manual/en/language.basic-syntax.phpmode.php
Other server-side scripting languages use similar techniques, eg:
ASP: http://msdn.microsoft.com/en-us/library/k33801s3.aspx JSP: http://java.sun.com/products/jsp/syntax/2.0/syntaxref20.html Cold fusion: http://www.opencfml.org/dashboard.action
Such syntax abuse all started with server-side includes back in the 90's:
http://hoohoo.ncsa.illinois.edu/docs/tutorials/includes.html
HTH, Phil.