beginning php5 apache and mysql web development

819 933 0
 beginning php5 apache and mysql web development

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Tài liệu về học lập trình web bằng ngôn ngữ PHP cho tất cả mọi người.

[...]... 3: Using PHP5 with MySQL Overview of MySQL Structure and Syntax MySQL Structure Field Types Choosing the Right Field Type null/not null Indexes Unique Auto Increment Other Parameters Types of MySQL Tables and Storage Engines MySQL Syntax and Commands How PHP Fits with MySQL Connecting to the MySQL Server Looking at a Ready-Made Database Querying the Database WHERE, oh WHERE Working with PHP and Arrays... Something? Checking for Format Errors Summary Exercise Chapter 9: Handling and Avoiding Errors How the Apache Web Server Deals with Errors Apache s ErrorDocument Directive Apache s ErrorDocument: Advanced Custom Error Page Error Handling and Creating Error Handling Pages with PHP Error Types in PHP Generating PHP Errors Other Methods of Error Handling Exceptions Not Meeting Conditions Parse Errors Summary... book, you will be able to create a well-designed, dynamic Web site using tools available for free Although this book is not intended to be a detailed analysis of Apache, PHP, and MySQL, it points you in the right direction to explore further issues you may wish to delve into Brief Intro to PHP, Apache, MySQL, and Open Source PHP, Apache, and MySQL are all part of the open source group of software programs... role each of these programs (Apache, MySQL, and PHP) plays in creating your Web site Imagine that your dynamic Web site is a fancy restaurant Diners come to your place, and each one wants something different and specific They don’t worry so much about how the food is prepared, as long as it looks and tastes delicious Unlike a buffet-type spread, where everything is laid out and your patrons simply choose... is live and running, because your settings may differ from those on your Webhosting company’s server Even a small difference can cause you big headaches Apache Apache acts as your Web server Its main job is to parse any file requested by a browser and display the correct results according to the code within that file Apache is quite powerful and can accomplish virtually any task that you, as a Webmaster,... Along with Apache, PHP, and MySQL, the package includes Perl and phpMyAdmin (another powerful database administration system we discuss in Chapter 3) XAMPP XAMPP, available at http://sourceforge.net/projects/xampp, is an open source installer that will install Apache, MySQL, PHP, Perl, phpMyAdmin, and an FTP server It is suitable for Linux, Solaris, and Windows systems Configuring Your Apache Installation... Installation Configuring PHP5 to Use MySQL 13 14 16 Configuring Your MySQL Installation Testing Your Installation Configuring Your Installation The my.cnf File Setting Up Users and Privileges Where to Go for Help and Other Valuable Resources Help within the Programs Source Web Sites Summary 17 17 19 21 24 25 25 25 26 Contents Part II: Movie Review Web Site 27 Chapter 2: Creating PHP Pages Using PHP5 29 Overview... to expand your use of built-in PHP functions to take advantage of its tremendous power You can download the PHP software from PHP’s Web site at www.php.net MySQL Another open source favorite, MySQL is the database construct that enables PHP and Apache to work together to access and display data in a readable format to a browser It is a Structured Query Language server designed for heavy loads and processing... Your Installation You’ve spent your hard-earned money and purchased this book, so you undoubtedly know the enormous benefits of using PHP, Apache, and MySQL together to create your Web site But in case you found this book on your desk one Monday morning with a sticky note reading “Learn this!,” this chapter looks at the basics of PHP, MySQL, and Apache to show you what makes the “AMP” combination so... Apache, the default being c:\program files \Apache Group \Apache2 \bin\; click Apache. exe to start your Apache HTTP server ❑ 8 During installation, the default option is to add Apache to your Start menu, so unless you disabled this, you can locate the Apache HTTP Server listing directly from your Start button This gives you shortcuts to starting the server and to testing and configuring features, as well At

Ngày đăng: 24/01/2014, 13:33

Từ khóa liên quan

Mục lục

  • Beginning PHP5, Apache, and MySQL Web Development

    • Cover

  • Contents

  • Part I: Getting Started

    • Chapter 1: Configuring Your Installation

      • Projects in This Book

      • Brief Intro to PHP, Apache, MySQL, and Open Source

        • A Brief History of Open Source Initiatives

        • Why Open Source Rocks

      • How the Pieces of the AMP Module Work Together

        • Apache

        • PHP

        • MySQL

        • AMP Installers

        • Foxserv

        • PHPTriad

        • XAMPP

      • Configuring Your Apache Installation

        • Testing Your Installation

        • Customizing Your Installation

        • Adding PHP to the Equation

        • Document Root

      • Configuring Your PHP Installation

        • Testing Your Installation

        • Customizing Your Installation

        • Configuring PHP5 to Use MySQL

      • Configuring Your MySQL Installation

        • Testing Your Installation

        • Configuring Your Installation

        • The my.cnf File

        • Setting Up Users and Privileges

      • Where to Go for Help and Other Valuable Resources

        • Help within the Programs

        • Source Web Sites

      • Summary

  • Part II: Movie Review Web Site

    • Chapter 2: Creating PHP Pages Using PHP5

      • Overview of PHP Structure and Syntax

        • How PHP Fits with HTML

        • The Rules of PHP Syntax

        • The Importance of Coding Practices

        • What Makes a Great Program?

        • Why Should You Care about What Your Code Looks Like?

      • Creating Your First Program

      • Using HTML to Spice Up Your Pages

        • Integrating HTML with PHP

        • Considerations with HTML Inside PHP

      • Using Constants and Variables to Add Functionality

        • Overview of Constants

        • Overview of Variables

      • Passing Variables between Pages

        • A Word about register_globals

        • Passing Variables through a URL

        • Special Characters in URLs

        • Passing Variables with Sessions

        • Passing Variables with Cookies

        • Passing Information with Forms

        • Fast Primer on Forms

      • Using if/else Arguments

        • Using if Statements

        • Operators

        • Special Syntax Considerations

        • Using if and else Together

      • Using Includes for Efficient Code

      • Using Functions for Efficient Code

      • All About Arrays

        • Array Syntax

        • Sorting Arrays

        • foreach Constructs

      • While You're Here . . .

      • Alternate Syntax for PHP

        • Alternates to the <?php and ?> Tags

        • Alternates to the echo Command

        • Alternates to Logical Operators

        • Alternates to Double Quotes: Using heredoc

        • Alternates to Incrementing/Decrementing Values

      • OOP Dreams

        • A Brief OOP Example

        • Why Use OOP?

      • Summary

      • Exercises

    • Chapter 3: Using PHP5 with MySQL

      • Overview of MySQL Structure and Syntax

        • MySQL Structure

        • Field Types

        • Choosing the Right Field Type

        • null/not null

        • Indexes

        • Unique

        • Auto Increment

        • Other Parameters

        • Types of MySQL Tables and Storage Engines

        • MySQL Syntax and Commands

      • How PHP Fits with MySQL

      • Connecting to the MySQL Server

      • Looking at a Ready-Made Database

      • Querying the Database

        • WHERE, oh WHERE

        • Working with PHP and Arrays of Data: foreach

        • A Tale of Two Tables

        • Referencing Two Tables

        • Joining Two Tables

      • Helpful Tips and Suggestions

        • Documentation

        • Using PHPMyAdmin

      • Summary

      • Exercises

    • Chapter 4: Using Tables to Display Data

      • Creating a Table

      • Populating the Table

      • Who's the Master?

      • A Lasting Relationship

      • Summary

      • Exercises

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

      • Your First Form

        • FORM Element

        • INPUT Element

        • Processing the Form

      • Driving the User Input

        • INPUT Checkbox Type

        • One Form, Multiple Processing

        • Radio INPUT Element

        • Multiple Submit Buttons

        • Basic Input Testing

        • Dynamic Page Title

        • Manipulating a String as an Array to Change the Case of the First Character

        • Ternary Operator

      • Using Form Elements Together

        • The Skeleton Script

        • Default Response

        • Adding Items

      • Summary

      • Exercises

    • Chapter 6: Letting the User Edit the Database

      • Preparing the Battlefield

      • Inserting a Simple Record from phpMyAdmin

      • Inserting a Record in a Relational Database

      • Deleting a Record

      • Editing Data in a Record

      • Summary

      • Exercise

    • Chapter 7: Manipulating and Creating Images with PHP

      • Working with the GD Library

        • What File Types Can I Use with GD and PHP?

        • Compiling PHP with GD

      • Allowing Users to Upload Images

      • Converting Image File Types

      • Black and White

      • Adding Captions

      • Adding Watermarks and Merging Images

      • Creating Thumbnails

      • Summary

      • Exercises

    • Chapter 8: Validating User Input

      • Users Are Users Are Users . . .

      • Incorporating Validation into the Movie Site

      • Forgot Something?

      • Checking for Format Errors

      • Summary

      • Exercise

    • Chapter 9: Handling and Avoiding Errors

      • How the Apache Web Server Deals with Errors

        • Apache's ErrorDocument Directive

        • Apache's ErrorDocument: Advanced Custom Error Page

      • Error Handling and Creating Error Handling Pages with PHP

        • Error Types in PHP

        • Generating PHP Errors

      • Other Methods of Error Handling

        • Exceptions

        • Not Meeting Conditions

        • Parse Errors

      • Summary

      • Exercises

  • Part III: Comic Book Fan Site

    • Chapter 10: Building Databases

      • Getting Started

        • What Is a Relational Database?

        • Keys

        • Relationships

        • Referential Integrity

        • Normalization

      • Designing Your Database

        • Creating the First Table

        • What's So Normal About These Forms?

        • Standardization

        • Finalizing the Database Design

      • Creating a Database in MySQL

      • Creating the Comic Character Application

        • charlist.php

        • charedit.php

      • Summary

      • Exercises

    • Chapter 11: Sending E-mail

      • Setting Up PHP to Use E-mail

      • Sending an E-mail

      • Dressing Up Your E-mails with HTML

        • Multipart Messages

      • Storing Images

      • Getting Confirmation

      • Creating a Reusable Mail Class

      • Summary

      • Exercises

    • Chapter 12: User Logins, Profiles, and Personalization

      • The Easiest Way to Protect Your Files

      • Friendlier Logins Using PHP's Session and Cookie Functions

      • Using Database-Driven Information

        • Using Cookies in PHP

        • Administrator Registration

      • Summary

      • Exercises

    • Chapter 13: Building a Content Management System

      • Getting Your Users to Return

        • Content

        • Management

        • System

        • Putting It All Together

      • Preparing the Database

      • Coding for Reusability

        • outputfunctions.php

        • header.php

        • http.php

      • Transaction Pages

      • User Interface

        • General Functionality

        • User Management

        • Article Publishing

        • Additional CMS Features

      • Summary

      • Exercises

    • Chapter 14: Mailing Lists

      • What Do You Want to Send Today?

      • Coding the Administration Application

      • Sign Me Up!

        • user.php

        • user_transact.php

        • thanks.php

      • Mailing List Ethics

        • A Word About Spam

        • Opt-In versus Opt-Out

      • Summary

      • Exercises

    • Chapter 15: Online Stores

      • Adding E-Commerce to the Comic Book Fan Site

        • Something to Sell

        • A Shopping Cart

        • Shopping Cart Software

        • Your Own Cart Software Code

      • E-Commerce, Any Way You Slice It

        • Information Is Everything

        • Importance of Trust

        • Privacy Policy

        • Return Policy

        • Warm Bodies

        • Secure Credit Card Processing

        • Professional Look

        • Easy Navigation

        • Common Links

        • Search Function

        • Typical Design

        • Competitive Pricing

        • Appropriate Merchandise

        • Timely Delivery

        • Communication

        • Customer Feedback

      • Summary

      • Exercises

    • Chapter 16: Creating a Bulletin Board System

      • Your Bulletin Board

      • Preparing the Database

      • Reusable Code

        • Pagination

        • Breadcrumbs

        • A Last Look at User Authentication

      • Transaction Pages

      • Account Functionality

        • User Administration

      • Forum Functionality

        • Board Administration

        • Forum Administration

        • BBcode Administration

        • Regular Expressions

        • The Two Types of regex Functions

        • How to Write a PCRE regex

        • Searching

      • Afterthoughts

      • Summary

      • Exercises

    • Chapter 17: Using Log Files to Improve Your Site

      • Locating Your Logs

        • Apache

        • PHP

        • MySQL

      • Analyzing Your Log Data

        • Webalizer

        • Analog

        • WebTrends

        • AWStats

        • HTTP Analyze

      • Putting the Analysis to Work

        • Site Health

        • User Preferences and Information

        • Number of Hits and Page Views

        • Trends over Time

        • Referring Sites

      • Summary

    • Chapter 18: Troubleshooting

      • Installation Troubleshooting

      • Parse Errors

        • Cleanup on Line 26 . . . Oops, I Mean 94

        • Elementary, My Dear Watson!

      • Empty Variables

        • The Ultimate Bait-and-Switch

        • Consistent and Valid Variable Names

        • Open a New Browser

      • "Headers Already Sent" Error

      • General Debugging Tips

        • Using echo

        • Divide and Conquer

        • Test, Test, Test!

      • Where to Go for Help

        • www.wrox.com

        • PHPBuilder.com

        • Source Web Sites

        • Search and Rescue

        • IRC Channels

      • Summary

  • Appendix A: Answers to Exercises

  • Appendix B: PHP Quick Reference

  • Appendix C: PHP5 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

  • Index

  • Team DDU

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan