Skip to main content

Creating Interactive Websites with PHP and Web Services

Creating Interactive Websites with PHP and Web Services

Eric Rosebrock

ISBN: 978-0-782-14279-2

Dec 2003

432 pages

Select type: Paperback

Product not available for purchase

Description

Build Dynamic Websites with PHP and MySQL—and Extend Those Sites with Web Services

PHP and MySQL are great tools for building database-driven websites. There's nothing new about that. What is new is the environment in which your site operates—a world rich (and growing richer) in web services that can add value and functionality in many different ways. Creating Interactive Web Sites with PHP and Web Services walks you through every step of a major web project—a content-management system—teaching you both the basic techniques and little-known tricks you need to build successful web sites. And you can use those skills to develop dynamic applications that will meet your special requirements. Here's some of what you'll find covered inside:

  • Adding, deleting, and displaying data with a custom content-management system
  • Building a template system with PHP
  • Interacting with web services using PHP and MySQL
  • Creating and managing a user system and a shopping cart
  • Processing credit card payments using merchant accounts and third-party payment solutions
  • Tracking site statistics using PHP and MySQL
  • Enhancing your site with third-party scripts

Tons of examples, complete with explanations and supported by online source code, will speed your progress, whether you're a true beginner or already have PHP experience. This book is platform-agnostic, so it doesn't matter if you're deploying your site on Linux or Windows. You also get PHP and MySQL references, so you can quickly resolve questions about syntax and similar issues.

Introduction.

Chapter 1: Introducing PHP.

Chapter 2: Planning Your Project.

Chapter 3: Building a Database Schema with MySQL.

Chapter 4: Building a Website Template with PHP.

Chapter 5: Creating a Website Membership System.

Chapter 6: Developing a Website News System.

Chapter 7: Enhancing Your Website with Web Services and APIs.

Chapter 8: Creating a Shopping Cart System.

Chapter 9: Processing Payments for Your Website.

Chapter 10: Tracking Website Statistics.

Chapter 11: Using Third-Party PHP Scripts.

Chapter 12: Closing Statements.

Appendix A: PHP Reference.

Appendix B: MySQL Syntax Reference.

Index.

Download all the code files for the book in .zip format
This zip file contains all the code from the book. It will extract to a folder titled 4279-6_Code and can be used along with the book's lessons.
Download
ChapterPageDetailsDatePrint Run
71Code Correction,The last three lines lines of code shoud read:
<?php
} //close footer()
?>
73Code Correction,Comment on closing bracket should read: //close myfooter()

Incorrect: // close myheader()

Correct: // close myfooter()

78Two Code Corrections,First instance of $meta.=“<TITLE>$this->sitename – “.
Change to: $meta = “<TITLE>$this->sitename – “.

Third instance of $meta.= “<TITLE>$this->sitename: – “.
Change to: $meta = “<TITLE>$this->sitename: – “.

96Code Correction,Change first instance of
$errors .=”<strong>Form Input Errors:”.
“</strong>\n\n”

To:
$errors = “<strong>Form Input Errors:”.
“</strong>\n\n”;
118Code Correction,Change first instance of
$errors .=”<strong>Form Input Errors:”.
“</strong>\n\n”

To:
$errors = “<strong>Form Input Errors:”.
“</strong>\n\n”;
120Text Correction,Third paragraph: // If username exists, generate error and message.

Should read: // If username/e-mail address exists, generate error and message.

131Code Correction,Change:

$alphanum = “abcdhefghjkmnpqrstuvwxyz0123456789”;

To:

$alphanum = “abcdefghjkmnpqrstuvwxyz0123456789”;

138Code Correction,Change both references of:

echo '<a href==”/lostpw.php”>Lost Password?</a>';

To:

echo '<a href=”/lostpw.php”>Lost Password?</a>';

Author's NoteAuthor's Note,This book assumes that you have PHP’s error_reporting and display_errors directives turned off on the local website you are developing on. Please look at your php.ini, make the appropriate changes and then restart your web server. You may alternatively set these PHP directives in your web site Document Root directory via the .htaccess file or your httpd.conf file for Apache. This book also requires you to have PHP’s short_open_tags directive turned on. An indication that this is not turned on is that you may notice PHP code echoed through your form fields. Turn this directive On and then restart your web server.
Entire BookCode Correction,Change all references of:

switch($_REQUEST[‘req’]){

To:

$req = (!isset($_REQUEST['req'])) ? 'default' : $_REQUEST['req'];
switch($req){