PHP 101 (Part 1) - Secret Agent Man (
Page 1 of 5 )
PHP is the hottest scripting language around - and with the release of PHP4, more and more developers are looking at it as a rapid Web development tool. This new series of tutorials is aimed at getting novice programmers up to speed on the language, and the first article covers variables, operators and the include() function call. Exploding chewing-gum is optional. Ever since Web designers found out about the
<FORM> tag, the Internet has seen an explosion in the number of Web sites that
depend heavily on user response and interactivity. For a long time, the primary
language used to develop such Web sites was
Perl. But ask any novice programmer, and he'll
tell you that learning Perl isn't exactly a bed of roses...
As a result,
there has been a proliferation of alternative server-side scripting languages,
which perform many of the tasks previously handled by Perl, but have a shorter
learning curve. The most well-known of these are ASP and PHP; while the former
works primarily on the Windows platform in combination with a clutch of
proprietary products, the latter has the unique distinction of being an
open-source server-side scripting language that's both fun and easy to learn.
Today, it is estimated that more than 1,000,000 Web sites use PHP as a server
side scripting language.
PHP was first developed by Rasmus Lerdorf as a
means of monitoring page views for his online resumé, and slowly started making
a mark when PHP/FI was released in mid-1995. This version of PHP had support for
some basic Web functions - the ability to handle form data, support for the mSQL
database, and more.
As PHP's popularity grew, the development of the
language shifted from Rasmus to a team of dedicated programmers who took upon
themselves the onus of rewriting the PHP parser from scratch. The result of the
efforts was PHP 3.0, which included support for a wider range of databases,
including MySQL and Oracle. And PHP 4.0, which was released a few weeks ago,
uses the powerful new Zend scripting engine to deliver better performance,
supports Web servers other than Apache, and comes with in-built support for
session management.
Our goal in this series of articles is very simple -
we'll be teaching you the basics of using PHP to power your Web site, and
related Web development efforts. The only assumptions we're going to make
throughout this series are that you know the basics of HTML, are using a
properly configured Web server running PHP4, and have a sense of
humour.
If you're running Apache, detailed instructions on configuring it
to work with PHP are available at
The Soothingly Seamless Setup of Apache, SSL, MySQL, and PHP
. Alternatively, download the latest distribution of PHP4 from the official PHP
Web site at
http://www.php.net and take a look
at the installation instructions.