Article

Home » Server-side Coding » PHP & MySQL Tutorials » The PHP Anthology Volume 1, Chapter 1 - PHP Basics

About the Author

Harry Fuecks

author_HarryF Harry has been working in corporate IT since 1994, with everything from start-ups to Fortune 100 companies. Outside of office hours he runs phpPatterns: a site dedicated to software design with PHP that aims to raise standards of PHP development. He also maintains Dynamically Typed: SitePoint's PHP blog.

View all articles by Harry Fuecks...

The PHP Anthology Volume 1, Chapter 1 - PHP Basics

By Harry Fuecks

December 19th, 2003

Reader Rating: 8

Page: 1 2 3 4 5 6 7 Next

PHP is a programming language that's designed specifically for building Websites, and is both blessed and cursed with being remarkably easy to learn and use. Getting started is extremely simple. Before long, the typical beginner can put together a simple Website and experiment with the wealth of open source projects available through resources like HotScripts.

Unfortunately, the ease with which PHP-based sites can be developed also means you can quickly get yourself into trouble. As traffic to your site increases, along with the demand for more features and greater complexity, it's important to gain a more intimate understanding of PHP, and to research application designs and techniques that have proved successful on large Websites. Of course, you can't leap into programming and expect to know it all straight away. Even if you could, where would be the fun in that?

This series begins to address the key issues facing PHP developers today. It comprises 5 articles:

From Volume I: Foundations:

Chapter 1: PHP Basics
This chapter provides a summary of all the essentials you need in order to get around quickly in PHP, from how to use the manual, to understanding PHP error messages, and how includes work. There are also some tips for writing portable code, and we'll take a look at some of the main PHP configuration pitfalls.

Chapter 2: Object Oriented PHP
The second chapter includes a run-down of PHP's class syntax, as well as a primer that explains how all the key elements of the Object Oriented Paradigm apply to PHP. It's essential preparatory reading for later chapters in this anthology.

Chapter 3: PHP and MySQL
This chapter provides you with all the essentials of MySQL, PHP's favorite database. We start with the basics, covering important topics such as how to avoid SQL injection attacks. We then delve more deeply into many lesser known topics, such as MySQL FULLTEXT search facilities, how to repair corrupt tables and back up your database, and how to avoid writing SQL with PEAR::DB_DataObject. This chapter also serves as a "case study" in designing a class to handle connecting to, and the querying of, your MySQL database.

From Volume 2: Applications

Chapter 1: Access Control
Beginning with basic HTTP authentication, then moving on to application level authentication, this chapter looks at ways to control access to your site. Later solutions look at implementing a user registration system and creating a fine-grained access control system with users, groups and permissions.

Chapter 5: Caching
This chapter takes the fundamental view that "HTML is fastest," and shows you how you can take advantage of caching on both the client and server sides to reduce bandwidth usage and dramatically improve performance.

The Book

The 5 chapters in this series are excerpts from my new book. The PHP Anthology, Volume I and Volume II contains not only the 5 chapters above, but 12 more chapters, which explore a selection of topics ranging from text manipulation, dates and times, and error handling, to XML, alternative content types, and stats and tracking.

If you'd prefer to read the Adobe Acrobat PDF version of this information, you can download these 5 chapters, plus sample reference material, FREE.

Your Feedback

If you have a question about any of the information covered in this series, your best chance of a quick response is to post your query in the SitePoint.com Forums. Suggestions for improvement as well as notices of any mistakes you may find (one or two may have slipped through the cracks) are especially welcome –- submit these to SitePoint Book Support.

Are you ready to launch forth into the wonderful world of PHP? Let's go!

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links