demosthenes.info

A blog by Dudley Storey on , , , , , , and anything else that strikes his fancy.

featured articles

popular favourites

PHP: Introduction

Rasmus Lerdorf, the original developer of PHP

PHP is a server-side processing language for web pages: that is, it processes code contained with PHP tags, displaying the result in the browser or doing something else with the information (storing it in a database, sending it via eMail, etc). Developed in 1994 by Rasmus Lerdorf, the PHP acronym stood for “Personal Home Page”, later changing to “PHP: Hypertext Processor” in one of the self-referential acronyms that plague the IT industry. Personally, I prefer Pre-Hypertext Processor, to make it clear that PHP runs before anything else on the page.

PHP is a server-side language. PHP code on a web page is executed by the server and turned into results for the client (typically a web browser). PHP can generate HTML, CSS, even graphics. The fact that PHP runs on the server means that, so long as it is correctly written, PHP just works: it does not depend on the client’s computer to operate or run correctly, thus avoiding the disadvantages of JavaScript and Flash.

PHP is one the most powerful technologies available to web developers, having six major advantages:

It is free and open source.

PHP is developed and maintained by a loose, world-wide collaborative group of software engineers and coders. Help for PHP is freely available (the best and primary resource being www.php.net). PHP isn’t proprietary to any one company: it is maintained by collective interest, not for profit. Apache and MySQL (the server and database solution we will be using in class, respectively) are also free and open source: you can download them and install them for free.

It can be interweaved with and .

Since anything outside a <?php ?> tag (the opening and closing tags of PHP, respectively) is interpreted as HTML, you can create static elements in HTML and interweave dynamic elements in PHP, all on the same page.

It is cross-platform.

Because it is interpreted by the server, not the client, PHP is not subject to the vagaries of interpretation by different browsers/platforms, etc. Once PHP runs correctly on a page, it will run the same forever, assuming that the server itself does not change.

PHP is expressly designed to create dynamic content for web pages.

Unlike Perl and other languages, PHP was designed for the web “from the ground up”.

The end user never sees PHP code.

Unlike HTML and JavaScript, PHP is interpreted into HTML “on the fly” when it is delivered from the server. No-one without access to your source files can ever see your PHP code.

It is relatively easy to use and learn.

PHP’s programming syntax is fairly straightforward, similar to ActionScript and other languages you have likely encountered thus far. The major problems people have with PHP are the same ones they have with other languages.

web developer guide

featured comment

by JoelB in Goodbye, JQuery Validation: HTML5 Form Errors With CSS3

what i'm reading

A Storm of Swords: A Song of Ice and Fire: Book Three
A Storm of Swords: A Song of Ice and Fire: Book Three

what i'm watching

Californication: The Third Season
Californication: The Third Season

what i'm playing

Mass Effect 3 Collector's Edition
Mass Effect 3 Collector's Edition

what i'm hearing

Dub FX
Dub FX

blogs

podcasts

no ads ever

This blog is free of advertising, and always will be.

creative commons licensed

The content of this blog is free to use in whatever way you wish under the Creative Commons license.