Print this page Share

Beginning PHP, Apache, MySQL Web Development

Beginning PHP, Apache, MySQL Web Development (0764557440) cover image


What is this book about?

PHP, Apache, and MySQL are the three key open source technologies that form the basis for most active Web servers. This book takes you step-by-step through understanding each — using it and combining it with the other two on both Linux and Windows servers.

This book guides you through creating your own sites using the open source AMP model. You discover how to install PHP, Apache, and MySQL. Then you create PHP Web pages, including database management and security. Finally, you discover how to integrate your work with e-commerce and other technologies. By building different types of Web sites, you progress from setting up simple database tables to tapping the full potential of PHP, Apache, and MySQL.

When you’re finished, you will be able to create well-designed, dynamic Web sites using open source tools.

What does this book cover?

Here's what you will learn from this book:

  • How PHP server-side scripting language works for connecting HTML-based Web pages to a backend database
  • Syntax, functions, and commands for PHP, Apache, and MySQL
  • Methods and techniques for building user-friendly forms
  • How to easily store, update, and access information using MySQL
  • Ways to allow the user to edit a database
  • E-commerce applications using these three technologies
  • How to set up user logins, profiles, and personalizations
  • Proper protocols for error handling

Who is this book for?

This book is for beginners who are new to PHP and who need to learn quickly how to create Web sites using open source tools. Some basic HTML knowledge is helpful but not essential.

See More

Table of Contents


Part I: Getting Started.

Chapter 1: Introduction and Installation Configuration.

Part II: Movie Review Web Site.

Chapter 2: Creating PHP Pages.

Chapter 3: Using PHP with MySQL.

Chapter 4: Using Tables to Display Data.

Chapter 5: Form Elements: Letting the User Work with Data.

Chapter 6: Letting the User Edit the Database.

Chapter 7: Validating User Input.

Chapter 8: Handling and Avoiding Errors.

Part III: Comic Book Fan Site.

Chapter 9: Building Databases.

Chapter 10: E-mailing with PHP.

Chapter 11: User Logins, Profiles, and Personalization.

Chapter 12: Building a Content Management System.

Chapter 13: Mailing Lists.

Chapter 14: Online Selling: A Quick Way to E-Commerce.

Chapter 15: Creating a Bulletin Board System.

Part IV: Advanced Users.

Chapter 16: Using Log Files to Improve Your Site.

Chapter 17: Troubleshooting.

Appendix A: Answers to Exercises.

Appendix B: PHP Quick Reference.

Appendix C: PHP Functions.

Appendix D: MySQL Data Types.

Appendix E: MySQL Quick Reference.

Appendix F: Comparison of Text Editors.

Appendix G: Choosing a Third-Party Host.

Appendix H: An Introduction to PEAR.

Appendix I: AMP Installation.


See More

Author Information

Michael “BuzzLY” Glass has been a gladiator in the software/Web site development arena for more than eight years. He has more than ten years of commercial programming experience with a wide variety of technologies, including PHP, Java, Lotus Domino, and Vignette StoryServer. He divides his time between computer programming, playing pool in the APA, and running his Web site at www.ultimatespin.com. You can usually find him slinking around on the PHPBuilder.com forums, where he is a moderator with the nickname BuzzLY.

Yann “Bunkermaster” Le Scouarnec is the senior developer for Jolt Online Gaming, a British gaming company. He is a moderator at PHPBuilder.com and a developer of open source PHP software for the gaming community. He has also worked for major software corporations as a software quality expert.

Elizabeth Naramore has been programming with computers since a very young age, and, yes, she remembers when software was packaged on cassette tapes. Graduating from Miami University at age 20 with a degree in Organizational Behavior, she found a world of opportunity awaiting her—in corporate marketing. Her first love was always computers, however, and she found herself sucked back to the programming world in 1997 through Web site design and development (once a computer geek, always a computer geek). While she plans to return to Miami to get her Masters in Computer Science, she currently stays busy running several Web sites. Her main focus is in e-commerce and running www.giftsforengineers.com.
Elizabeth has spent the past six years developing Web sites and coordinating all phases of Web site publication and production. She is currently a moderator at PHPBuilder.com, an online help center for PHP. Her other interests include poetry, arts and crafts, camping, and juggling the many demands of career, family, and the “other duties as assigned” that come along in life. She lives in Cincinnati, Ohio, with her husband, beautiful daughter, and a new baby on the way.

Gary “trooper” Mailer. After graduation from university in 1998, Gary worked in a major software house in central London as a quality assurance engineer, and also as the departmental Web developer (using ASP). This gave him a taste of Web development. After a few years, he made the jump into full-time Web development and has not looked back since.
Gary has worked in a few different sectors, including communications (Siemens) and hotels (Hilton), as well as in “traditional” development houses.
He is currently a freelance developer for a European communications company. Gary has been and continues to be an active member of and contributor to the PHPBuilder.com site.

Jeremy “stolzboy” Stolz is a Web developer at Cloverfish Inc. (www.cloverfish.net), a Web development company in Fargo, North Dakota. Jeremy is primarily a PHP/MySQL developer, but he has also worked with many other languages. When not working, he frequents the Internet and tries to keep up his programming skills. He is a contributor to and moderator at PHPBuilder.com. He also frequents many other computer-related Web sites to keep his skills sharp and up to date.

Jason “goldbug” Gerner currently spends his days working as a Web developer in Cincinnati and burns free time complaining about lack of support for Web standards and abusing XML. He can often be found lurking in the PHPBuilder.com discussion forums, waiting to chime in with nagging comments about CSS or code efficiency.

See More


Download TitleSizeDownload
Download the example files here
Updates to "movie_details.php.12.txt", "ch04.htm" and "movie_details.php.11.txt" were added on 3/3/05 to fix the following error: Chapter 4, Page 130, Step 2: The book correctly shows ... mysql_query($movie_query,$link) or die ... however, the original "source code" from the Website was missing the critical change to "$movie_query," and shows "$query," only. This returns a "query was empty" error when the file is run.
222.50 KB Click to Download
See More


Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
(whole book) $e-mail is an invalid variable name
During the editing process, $email was changed to $e-mail, which is an invalid variable name. This variable name is used throughout the book on numerous occasions. Readers need to replace $e-mail with $email wherever applicable.
74 Code correction for parse error
At the bottom of page 74, under the "foreach Constructs" section, line 6 of the code currently states: foreach ($flavor, as $currentvalue) { It should read: foreach ($flavor as $currentvalue) {
2 96 Fatal error in createmovie.php code
Some people may have experienced an error in createmovie.php on page 96 because of a line of deprecated code. While this doesn't always cause an error, if you do get a fatal error, you can try this fix: INSTEAD OF mysql_create_db("wiley"); USE $query = mysql_query("CREATE DATABASE wiley") or die(mysql_error());
4 130 Error in code on web site for Step 2
Step 2: The book correctly shows ... mysql_query($movie_query,$link) or die ... however, the original "source code" from the Website was missing the critical change to "$movie_query," and shows "$query," only. This returns a "query was empty" error when the file is run.
Corrected code was posted on 3/11/05.
154 Error in Code
"file AddMovie.php" at the end...

for ($year=date("Y"); $year >= 1970 ;$year—){

Change them to:

for ($year=date("Y"); $year >= 1970 ;$year--){
14 491 Error in line 77 of code for checkout3.php
Line 77 of the code: There is a missing comma at the end of the line. Change to '$shipping',
14 493 Error in line 179 of code for checkout3.php
Code in line 179 is $message .= $quan; and should be $message .= $qty;
14 493 Error in line 189 of code for checkout3.php
Code in line 189 is $extprice = number_format($price * $quan, 2); and should be $extprice = number_format($price * $qty, 2);
14 495 Error in line 288 of code for checkout3.php
Code in line 288 is echo $quan; and should be echo $qty;
14 495 Error in line 298 of code for checkout3.php
Code in line 298 is $extprice = number_format($price * $quan, 2); and should be $extprice = number_format($price * $qty, 2);
See More

Related Titles

Back to Top