Core PHP Programming: Using PHP to Build Dynamic Web Sites

Author: Leon Atkinson
Publisher: Prentice Hall
E-mail: ptr_feedback@phptr.com
Price: $39.99 US
ISBN: 0-13-020787-X
Reviewer: Allen Riddell
The word “coattails” often comes up in political races, describing situations where a popular candidate, usually a presidential one, can carry other members of his party into office on the basis of his popularity—on his “coattails”. Such an analogy fits this year well. Instead of a year of elections, we have a year of Linux and Open Source, each carrying a wide array of programming languages and applications into the mainstream through association.
One language of note riding the Penguin's wake is a web scripting language called PHP that has gathered users at an impressive rate. PHP competes against a sea of languages used to generate “dynamic web pages”--pages that consist partly or wholly of code and are interpreted every time they are viewed. Rival languages include Microsoft's Active Server Pages (ASP), Allaire's Cold Fusion and even Perl. More established competition would be hard to find.
PHP's popularity is further evidenced by sales of the book Core PHP Programming by Leon Atkinson, one of the few available books on the language. The book, having already sold out of its first printing, has placed consistently in the bestsellers at the on-line computer book retailers. And, according to Atkinson's web page, a second edition is being considered.
With only one PHP book available, such popularity might be attributed to the subject rather than the quality of the book. In this case, PHP might as well be BASIC, for Atkinson's writing stands among the best in the expanse of computer books, bucking the trend of quantity over quality that plagues so many thousand-plus-page books. Atkinson's writing is uncommonly concise and comprehensive.
Atkinson begins sensibly with an introduction to the language, detailing its advantages over the competition. With something as intentionally transparent as a web scripting language, such discussion is vital. Surfers have little chance of knowing which sites employ any web scripting language. For instance, the popular software site for Linux, freshmeat.net, uses PHP exclusively, although users cannot detect it viewing the opening page. Atkinson advocacy is traditional for open-source software, arguing that it beats the competition in price and flexibility—notably, it can be modified freely and distributed.
PHP's introduction and language basics comprise the first of four sections in the book. The introduction is quite rudimentary, suitable for complete beginners to programming. Variable declaration and other important but introductory topics are discussed exclusively in the opening section. For many—if not most—readers familiar with Perl, a language that bears substantial similarity to PHP, drifting through basic concepts like type casting and for statements to find the key differences between languages may be frustrating. A section or two comparing PHP and Perl would have been nice. It is, however, not too problematic, as most readers will soon become familiar through examples or reference sections if they do not slog through the opening chapters.
Atkinson calls the second section a “functional reference”, combining a traditional function reference with detailed examples on each function. Despite the redundancy of nearly identical functions and examples for SQL database calls in MySQL, mSQL and PostgreSQL, the design serves another purpose. By giving an example with each function, Atkinson allows the reader to learn by example. Such instruction should suit the type of programmer who is familiar but not proficient with the language, assuring him with each example that he is using both the function and related functions correctly. And while the reference does take up the majority of the book, Atkinson keeps examples brief but useful.
For beginning users, the third section, entitled “Algorithms”, provides an interesting path for readers, building from stable searching and sorting methods like bubble and quick sort, to more functional examples like retrieval from SQL databases. Such a design may strike more advanced users as somewhat silly, since no need for a bubble sort exists when using SQL or most other databases commonly accessed by PHP. Indeed, actually using PHP to sort a large database would be inadvisable—such a scheme would essentially entail compiling and executing code to sort the database every time a browser viewed the page. While parts of the chapter do seem better suited for an introductory computer course, struggling users may find familiar computer-science algorithms implemented in PHP helpful.
In the final section, Atkinson shines, taking the crucial step away from teaching the language to applying it in real-world examples and advising how to make the language a true alternative to the heavyweights of ASP and Cold Fusion. He calls the section “Software Engineering”, in reference to the increasingly popular term “Web Engineer”--comparing the construction a programmer does to that of a civil engineer. Discussing issues of design, efficiency and debugging, Atkinson outlines the important aspect of using PHP, doing useful things with it, namely building web sites.
Considering PHP's rivals, discussion of web engineering with PHP serves one purpose beyond instruction: it adds to the credibility of the language as a serious rival to its high-priced and high-powered competitors. Through discussing how to efficiently design an expansive and maintainable site—something quite uncommon in an introductory text—Atkinson gets to the heart of one possible misconception of PHP, that it bears more resemblance in ability and function to something like JavaScript than a more “powerful” and “mainstream” package like ASP. The criticism has as little truth here as when levied at Linux and open-source applications, and in his discussions of databases and of efficiency in coding, Atkinson develops ways of unifying a site under PHP, employing it as a tool to build an underlying framework rather than as a method of enhancing a pre-existing one.
For his part, Atkinson has done a wonderful job. His precision and organization makes reading and learning PHP simple. What should concern those interested in PHP is not how to learn it—Atkinson has solved that problem—but where PHP, the language itself, is headed. As with many open-source applications, PHP is evolving quickly. One rather drastic change currently taking place is a rewrite of the underlying “engine” of PHP. The project to do so is called “Zend” and also involves a licensing change. While the promise of backward compatibility exists, the prospect of new and better functions or methods of coding looms. For some, this may be a reason to use caution; for others, another reason to start learning the language.
PHP's future is bright. Atkinson's book is an excellent companion for anyone interested in learning a promising language—fast growing coattails of its own.
Allen Beye Riddell (ariddell@concentric.net) currently attends Stanford University and has worked as a technology consultant for two years. PHP has been his language of choice for the past year—running on a Linux server, of course.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




7 hours 35 min ago
18 hours 16 min ago
1 day 2 min ago
1 day 19 min ago
1 day 2 hours ago
1 day 4 hours ago
1 day 11 hours ago
1 day 11 hours ago
1 day 13 hours ago
1 day 18 hours ago