Home > Computing and Information Technology > Computer programming / software engineering > Programming and scripting languages: general > Sams Teach Yourself PHP, MySQL and Apache All in One: (Sams Teach Yourself)
2%
Sams Teach Yourself PHP, MySQL and Apache All in One: (Sams Teach Yourself)

Sams Teach Yourself PHP, MySQL and Apache All in One: (Sams Teach Yourself)

          
5
4
3
2
1

International Edition


Premium quality
Premium quality
Bookswagon upholds the quality by delivering untarnished books. Quality, services and satisfaction are everything for us!
Easy Return
Easy return
Not satisfied with this product! Keep it in original condition and packaging to avail easy return policy.
Certified product
Certified product
First impression is the last impression! Address the book’s certification page, ISBN, publisher’s name, copyright page and print quality.
Secure Checkout
Secure checkout
Security at its finest! Login, browse, purchase and pay, every step is safe and secured.
Money back guarantee
Money-back guarantee:
It’s all about customers! For any kind of bad experience with the product, get your actual amount back after returning the product.
On time delivery
On-time delivery
At your doorstep on time! Get this book delivered without any delay.
Quantity:
Add to Wishlist

About the Book

In just a short time, you can learn how to use PHP, MySQL, and Apache together to create dynamic, interactive websites and applications using the three leading open-source web development technologies. Using a straightforward, step-by-step approach, each lesson in this book builds on the previous ones, enabling you to learn the essentials of PHP scripting, MySQL databases, and the Apache web server from the ground up.   Julie C. Meloni is a technical consultant who has been developing web-based applications since the Web first saw the light of day. She has authored numerous books and articles on web application development and HTML/CSS, and you can find translations of her work in 18 different languages.   Learn how to… • Install, configure, and set up the PHP scripting language, the MySQL database system, and the Apache Web server • Get these technologies to work together to create a dynamic, database-backed website • Interact with MySQL using PHP • Work with forms and files • Create a web-based discussion forum or mailing list • Add a storefront and shopping cart to your site • Optimize your MySQL databases • Fine-tune the Apache server’s performance • Restrict access to your applications • Set up a secure web server    

Table of Contents:
   Introduction 1 PART I: Getting Up and Running CHAPTER 1: Installation QuickStart Guide with XAMPP 5    Using Third-Party Installation Packages . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . 5    Installing XAMPP on Linux/UNIX . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . 6    Installing XAMPP on Windows . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . 8    Installing XAMPP on Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11    Securing XAMPP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13    Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 CHAPTER 2: Installing and Configuring MySQL 15    Current and Future Versions of MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15    How to Get MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . 16    Installing MySQL on Linux/UNIX . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . 16    Installing MySQL on Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . 18    Installing MySQL on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20    Troubleshooting Your Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26    Basic Security Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . 27    Introducing the MySQL Privilege System. . . . . . . . . . . . .  . . . . . . . . . . . . . . 28    Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . 34    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 CHAPTER 3: Installing and Configuring Apache 37    Current and Future Versions of Apache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37    Choosing the Appropriate Installation Method . . . . . . . . . . . . . . . . . . . . 38    Installing Apache on Linux/UNIX . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 39    Installing Apache on Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42    Installing Apache on Windows . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . 42    Apache Configuration File Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 45    Apache Log Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . . 50    Apache-Related Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51    Starting Apache for the First Time . . . . . . . . . . . . . . .  . . . . . . . . 53    Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55    Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 CHAPTER 4: Installing and Configuring PHP 59    Current and Future Versions of PHP . . . . . . . . . . . . . . . . . . . .  . . . . . . . . 59    Building PHP on Linux/UNIX with Apache . . . . . . . . . . . . . . . . . . . . . . . . . 60    Installing PHP on Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63    Installing PHP on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63    php.ini Basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65    Testing Your Installation . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . 65    Getting Installation Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66    The Basics of PHP Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67    Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . 73    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 73    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . 74 PART II: PHP Language Structure CHAPTER 5: The Building Blocks of PHP 75    Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75    Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78    Operators and Expressions . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 85    Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . 94    Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . 96 CHAPTER 6: Flow Control Functions in PHP 99    Switching Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . 99    Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . 105    Code Blocks and Browser Output . . . . . . . . . . . . . . . . . . . . . . . . . 114    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . 116    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . 116 CHAPTER 7: Working with Functions 119    What Is a Function? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119    Calling Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . 120    Defining a Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . 121    Returning Values from User-Defined Functions. . . . . . . . . . . . . . . . 124    Variable Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 125    Saving State Between Function Calls with the static Statement . . . . . . . . . . . . . . . . . . 128    More About Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . 130    Testing for the Existence of a Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . 136 CHAPTER 8: Working with Arrays 139    What Are Arrays? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139    Creating Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . 140    Some Array-Related Constructs and Functions . . . . . . . . . . . . . . .. . . . . . . . . . 144    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . 147 CHAPTER 9: Working with Objects 149    Creating an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150    Object Inheritance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . 155    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . 157    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . 157    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 157 PART III: Getting Involved with the Code CHAPTER 10: Working with Strings, Dates, and Time 159    Formatting Strings with PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160    Investigating Strings in PHP . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . 169    Manipulating Strings with PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . 173    Using Date and Time Functions in PHP. . . . . . . . . . . . . . . . . . . . . . . . . . . 179    Other String, Date, and Time Functions . . . . . . . . . . . . . . . . . .  . . . . . . 186    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . 186    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 CHAPTER 11: Working with Forms 189    Creating a Simple Input Form. . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . 189    Accessing Form Input with User-Defined Arrays . . . . . . . . . .. . . . . . . . . 191    Combining HTML and PHP Code on a Single Page . . . . . . . . . . . . . . 194    Using Hidden Fields to Save State. . . . . . . . . . . . . . . . . . . .. . . . . . 197    Redirecting the User. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198    Sending Mail on Form Submission . . . . . . . . . . . . . . . . .. . . . . . . . . . 200    Creating the Form. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 201    Creating the Script to Send the Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202    Working with File Uploads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 210    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . 211 CHAPTER 12: Working with Cookies and User Sessions 213    Introducing Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . 213    Setting a Cookie with PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215    Deleting a Cookie with PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217    Session Function Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 217    Starting a Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218    Working with Session Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219    Destroying Sessions and Unsetting Variables . . . . . . . . . . . . . . . . . .. . . . . . . . 223    Using Sessions in an Environment with Registered Users . . . . . .  . . . . . . 224    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . 225    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 226 CHAPTER 13: Working with Files and Directories 229    Including Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229    Using include_once . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233    Validating Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234    Creating and Deleting Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . 238    Opening a File for Writing, Reading, or Appending . . . . . . . . . . . . . . . . . . . . . . . 238    Reading from Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239    Writing or Appending to a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245    Working with Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248    Opening Pipes to and from Processes Using popen() . . . . . . . . . . .. . . . . . . 251    Running Commands with exec() . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . 254    Running Commands with system() or passthru() . . . . . . . . . . . . .. . . . . . 255    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . 258 CHAPTER 14: Working with Images 261    Understanding the Image-Creation Process . . . . . . . . . . . . . . . . . .  . . . . . . . . . 261    Necessary Modifications to PHP . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . 262    Drawing a New Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . 263    Modifying Existing Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271    Image Creation from User Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273    Using Images Created by Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . . 280    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . 281    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 PART IV: PHP and MySQL Integration CHAPTER 15: Understanding the Database Design Process 283    The Importance of Good Database Design . . . . . . . . . . . . . . . . . .  . . . . . . . 283    Types of Table Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284    Understanding Normalization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289    Following the Design Process. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 294 CHAPTER 16: Learning Basic SQL Commands 297    Learning the MySQL Data Types . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 298    Learning the Table-Creation Syntax . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . 301    Using the INSERT Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302    Using the SELECT Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304    Using WHERE in Your Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . 308    Selecting from Multiple Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . 310    Using the UPDATE Command to Modify Records . . . . . . . . . . . . . . . . . . 316    Using the REPLACE Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 319    Using the DELETE Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 320    Frequently Used String Functions in MySQL. . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 322    Using Date and Time Functions in MySQL . . . . . . . . . . . . . . . . . . . . . . .  . . . 331    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . 343    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 346 CHAPTER 17: Using Transactions and Stored Procedures in MySQL 349    What Are Transactions? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349    What Are Stored Procedures?. . . . . . . . . . . . . . . . . . . . . . . . . .. 353    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 CHAPTER 18: Interacting with MySQL Using PHP 357    MySQL or MySQLi Functions? . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . 357    Connecting to MySQL with PHP. . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . 358    Working with MySQL Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . 370 PART V: Basic Projects CHAPTER 19: Managing a Simple Mailing List 373    Developing the Subscription Mechanism. . . . . . . . . . . . . . . . . . . . . . . . . . 374    Developing the Mailing Mechanism. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 385    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 CHAPTER 20: Creating an Online Address Book 387    Planning and Creating the Database Tables . . . . . . . . . . . . . . . . . . . . . .. . . . 387    Creating an Include File for Common Functions . . . . . . . . . . . . . . . . . . . . 390    Creating a Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391    Creating the Record-Addition Mechanism . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 392    Viewing Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398    Creating the Record-Deletion Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . 404    Adding Subentries to a Record. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 406    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . 414    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414 CHAPTER 21: Creating a Simple Discussion Forum 417    Designing the Database Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417    Creating an Include File for Common Functions . . . . . . . . . . . . . . .. . . . . . . 418    Creating the Input Forms and Scripts . . . . . . . . . . . . . . . . . . . . . .  . . . . . . 419    Displaying the Topic List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . 423    Displaying the Posts in a Topic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426    Adding Posts to a Topic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 433    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . 434    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 434 CHAPTER 22: Creating an Online Storefront 437    Planning and Creating the Database Tables . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . 437    Displaying Categories of Items . . . . . . . . . . . . . . . . . . . . . . . 441    Displaying Items. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . 445    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . 448 CHAPTER 23: Creating a Shopping Cart Mechanism 451    Planning and Creating the Database Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451    Integrating the Cart with Your Storefront . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 453    Payment Methods and the Checkout Sequence. . . . . . . . . . . . . . . . . .  . . . . . . . 462    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465 CHAPTER 24: Creating a Simple Calendar 467    Building a Simple Display Calendar. . . . . . . . . . . . . . . . . . . . . . . . . . . 467    Creating a Calendar Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . 483    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . 489 CHAPTER 25: Restricting Access to Your Applications 491    Authentication Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491    Apache Authentication Module Functionality . . . . . . . . . . . . . . . . . . . . . . . . 493    Using Apache for Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497    Combining Apache Access Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500    Limiting Access Based on HTTP Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501    Restricting Access Based on Cookie Values. . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 501    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . 507    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . 508 CHAPTER 26: Logging and Monitoring Web Server Activity 509    Standard Apache Access Logging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509    Standard Apache Error Logging. . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 515    Managing Apache Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517    Logging Custom Information to a Database . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . 519    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . 524    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 CHAPTER 27: Application Localization 527    About Internationalization and Localization . . . . . . . . . . . . . . .. . . . . 527    About Character Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 528    Environment Modifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529    Creating a Localized Page Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531    Localizing Your Application with gettext(). . . . . . . . . . . . . . . . . .  . . . . . . . 536    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538 CHAPTER 28: Working with XML and JSON 541    What Is XML?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . 541    Accessing XML in PHP Using DOM Functions . . . . . . . . . . . .  . . . . . . . . . . . . . . 544    Accessing XML in PHP Using SimpleXML Functions . . . . . . . . . . . . . . . . . . . 546    Working with JSON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . 549    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 554 PART VI: Administration and Fine-Tuning CHAPTER 29: Apache Performance Tuning and Virtual Hosting 555    Performance and Scalability Issues. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 555    Load Testing with ApacheBench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559    Proactive Performance Tuning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561    Preventing Abuse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . 563    Implementing Virtual Hosting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . 569    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 571 CHAPTER 30: Setting Up a Secure Web Server 573    The Need for Security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . 573    The SSL Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574    Obtaining and Installing SSL Tools . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . 579    Managing Certificates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . 582    SSL Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . 586    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . 586 CHAPTER 31: Optimizing and Tuning MySQL 589    Building an Optimized Platform . . . . . . . . . . . . . . . . . . . . . . . . .. . 589    Benchmarking Your Database Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590    MySQL Startup Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591    Optimizing Your Table Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593    Optimizing Your Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . 594    Using the FLUSH Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . 595    Using the SHOW Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . 596    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603    Q&A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604 CHAPTER 32: Performing Software Upgrades 605    Staying in the Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . 605    Upgrading MySQL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607    Upgrading Apache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608    Upgrading PHP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610 CHAPTER 33: Using Application Frameworks 611    Understanding Application Frameworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611    Using the MVC Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . 612    Installing and Using PHP Application Frameworks . . . . . . . . . . . . . . . . . 614    Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . 617    Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . 617    Activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . 618 TOC, 9780672335433, 5/2/2012  


Best Sellers


Product Details
  • ISBN-13: 9780132603645
  • Publisher: Pearson Education (US)
  • Publisher Imprint: Addison Wesley
  • Language: English
  • Series Title: Sams Teach Yourself
  • ISBN-10: 0132603640
  • Publisher Date: 25 May 2012
  • Binding: Digital download
  • No of Pages: 672
  • Weight: 1 gr


Similar Products

How would you rate your experience shopping for books on Bookswagon?

Add Photo
Add Photo

Customer Reviews

REVIEWS           
Click Here To Be The First to Review this Product
Sams Teach Yourself PHP, MySQL and Apache All in One: (Sams Teach Yourself)
Pearson Education (US) -
Sams Teach Yourself PHP, MySQL and Apache All in One: (Sams Teach Yourself)
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Sams Teach Yourself PHP, MySQL and Apache All in One: (Sams Teach Yourself)

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book
    Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    New Arrivals

    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!
    ASK VIDYA