Department of Mathematics FAS Harvard University One Oxford Street Cambridge MA 02138 USA Tel: (617) 495-2171 Fax: (617) 495-5132
FAS Computer Services to Harvard University IT: (617) 495-7777.
The Hypertext Preprocessor PHP is a server-side scripting language. PHP code is usuallly embedded into HTML. PHP can be used on the webpages of the Mathematics department. (The latest installed version is Php-4.4.7). The open source software PHP4 does the same as the commercial and proprietary products Microsofts Active Server Pages (ASP), Allair's ColdFusion and Sun's Java Server Pages. The benchmark results are comparable or better, the possibility to inspect the source code improves security. PHP is now the most popular Apache module (Nov 1999: 1 Mio Hosts, Oct 2000, 3.8 Mio Hosts, Aug 2005, 20 Mio Hosts (source)).
To see how PHP is used, consider count.php. (Source count.txt). PHP can replace CGI programs because it can write to files or execute server commands. The today date at the bottom of this page for example is obtained by executing the command "date" on the server. The HTML contained just the line date.php (source date.txt),
Note: The use of server-side scripting languages make sense if the website depends on a large database which changes frequently. Whenever possible, it is preferable to use static websites or to delegate the work to the client. The javascript program count.html for example (with source count.html.txt ), does exactly the same as count.txt, but transfers only a 80 Bytes size file to the client, who then builds the 4K page. In the PHP version, the server computed the 4K HTML file and transfered it.

Links Literature
  • The PHP4 Bible by Tim Converse and Joyce Park

Simplicity, Clarity, Generality B.W. Kernighan, R. Pike, in "The Practice of Programming".