Skip to main content

Beginning PHP, Apache, MySQL Web Development

Beginning PHP, Apache, MySQL Web Development

Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner

ISBN: 978-0-764-55744-6

Mar 2004

720 pages

Select type: Paperback

Product not available for purchase


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.


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.


Code Downloads
Code downloads for this title are available here.
Download the example files here
Code Downloads
Code downloads for this title are available here.
Download the example files here
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.

74Code 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) {

296Fatal 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());

4130Error 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.

154Error 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--){

14491Error 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',

14493Error in line 179 of code for checkout3.php
Code in line 179 is $message .= $quan; and should be $message .= $qty;

14493Error 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);

14495Error in line 288 of code for checkout3.php
Code in line 288 is echo $quan; and should be echo $qty;

14495Error 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);