Summary
"Practical PHP and MySQL reflects Jono's commitment to the spirit of making open source subjects accessible to everyone. The book carefully walks you through the code for eight useful, dynamic Web applications. Projects are presented in a playful way, like the forum project that touts horror movies that make you 'hide behind the couch.'" -From the Foreword by Christopher Negus, Series Editor, Negus Live Linux Series Build Dynamic Web Sites Fast, with PHP and MySQL... Learn from Eight Ready-to-Run Applications! Suddenly, itrs"seasyto build commercial-quality Web applications using free and open source software. With this book, yours"ll learn from eight ready-to-run, real-world applications--all backed by clear diagrams and screenshots, well-documented code, and simple, practical explanations. Leading open source author Jono Bacon teaches the core skills yours"ll need to build virtually any application. Yours"ll discover how to connect with databases, upload content, perform cascading deletes, edit records, validate registrations, specify user security, create reusable components, use PEAR extensions, and even build Ajax applications. Working from complete examples on the CD-ROM, yours"ll create Generic dynamic Web sites Blogs Discussion forums Shopping carts Auction sites Calendars FAQ systems Reusable components Content management systems News sites JONO BACONis Ubuntu community manager for Canonical, Ubunturs"s sponsor. He is an established speaker, author, and contributor to the open source community. Bacon co-authoredLinux Desktop HacksandThe Official Ubuntu Book; has served as a columnist forLinux Format,Linux User & Developer, andPC Plus; and is an Ors"Reilly Networkweblog author. He is a lead developer onthe Jokosher (www.jokosher.org) project,and co-founder of LUGRadio-a podcastwith more than 15,000 listeners, andan annual event that attracts visitorsfrom around the world. CD-ROM Includes XAMPP for Linux: easy-to-install, preconfigured Apache distributions containing MySQL, PHP, Perl, and more Source code for all eight fully-working applications discussed in the book A remastered Ubuntu live CD, set to run all eight applications live System Requirements CPU: Pentium III, 650 MHz. RAM: 256MB (recommended 512MB). Hard disk: No space required to run live CD; 250MB of space needed to put XAMPP server and projects on installed system.
Author Biography
Jono Bacon works for Canonical as the Ubuntu community manager and is an established speaker, author, and regular contributor to the Open Source community. As an author, Bacon co-authored Linux Desktop Hacks and the Official Ubuntu Book, and has written more than 400 published articles in more than 14 publications. Bacon has also contributed as a columnist for Linux Format, Linux User & Developer, and PC Plus, and is an O’Reilly Network weblog author.
In addition, Bacon is a regular contributor to Open Source in a range of projects, a lead developer on the Jokosher (www.jokosher.org) project, and one of the co-founders of the popular LUGRadio (www.lugradio.org) podcast–a show with more than 15,000 listeners and an annual event that pulls visitors from around the world.
Table of Contents
| Foreword |
|
xi | |
| About the Author |
|
xii | |
| Acknowledgments |
|
xiii | |
| Introduction |
|
1 | (1) |
|
|
|
1 | (2) |
|
What You Need to Use This Book |
|
|
3 | (1) |
|
|
|
4 | (1) |
|
|
|
4 | (1) |
|
|
|
5 | (10) |
|
|
|
6 | (2) |
|
How the Dynamic Web Works |
|
|
8 | (4) |
|
|
|
12 | (3) |
|
Getting Started with PHP and MySQL |
|
|
15 | (38) |
|
|
|
16 | (1) |
|
|
|
17 | (18) |
|
|
|
35 | (10) |
|
Connecting to MySQL in PHP |
|
|
45 | (6) |
|
|
|
51 | (2) |
|
|
|
53 | (10) |
|
|
|
53 | (3) |
|
|
|
56 | (1) |
|
|
|
57 | (3) |
|
|
|
60 | (3) |
|
|
|
63 | (48) |
|
Project Overview: Blogtastic Use Case |
|
|
64 | (1) |
|
|
|
65 | (3) |
|
|
|
68 | (14) |
|
|
|
82 | (10) |
|
Building the Category Browser |
|
|
92 | (3) |
|
Don't Just Let Anyone Log In |
|
|
95 | (7) |
|
Rolling Your Own Categories |
|
|
102 | (1) |
|
Creating New Blog Entries |
|
|
103 | (3) |
|
|
|
106 | (4) |
|
|
|
110 | (1) |
|
|
|
111 | (58) |
|
|
|
111 | (3) |
|
|
|
114 | (1) |
|
|
|
114 | (1) |
|
|
|
115 | (7) |
|
|
|
122 | (2) |
|
|
|
124 | (9) |
|
|
|
133 | (17) |
|
|
|
150 | (8) |
|
Creating Administrator-Specific Pages |
|
|
158 | (9) |
|
|
|
167 | (2) |
|
|
|
169 | (50) |
|
|
|
170 | (1) |
|
|
|
171 | (4) |
|
|
|
175 | (5) |
|
|
|
180 | (4) |
|
Displaying and Selecting Products |
|
|
184 | (12) |
|
|
|
196 | (12) |
|
|
|
208 | (8) |
|
|
|
216 | (3) |
|
Building an Online Auction Site |
|
|
219 | (46) |
|
|
|
219 | (1) |
|
|
|
220 | (3) |
|
|
|
223 | (3) |
|
|
|
226 | (14) |
|
|
|
240 | (3) |
|
|
|
243 | (16) |
|
|
|
259 | (3) |
|
Scheduling the Page to Be Run |
|
|
262 | (1) |
|
|
|
263 | (2) |
|
Creating a Web-Based Calendar |
|
|
265 | (38) |
|
|
|
265 | (1) |
|
|
|
266 | (1) |
|
|
|
267 | (10) |
|
|
|
277 | (25) |
|
|
|
302 | (1) |
|
FAQ Content Management System |
|
|
303 | (76) |
|
|
|
304 | (1) |
|
|
|
305 | (5) |
|
|
|
310 | (11) |
|
|
|
321 | (9) |
|
|
|
330 | (11) |
|
Adding and Moderating Questions |
|
|
341 | (15) |
|
|
|
356 | (4) |
|
|
|
360 | (4) |
|
|
|
364 | (12) |
|
|
|
376 | (3) |
|
Building a Re-Usable Project |
|
|
379 | (46) |
|
|
|
380 | (1) |
|
|
|
381 | (4) |
|
Using Directories Intelligently |
|
|
385 | (1) |
|
Starting to Code: Building the Backbone |
|
|
386 | (7) |
|
|
|
393 | (3) |
|
|
|
396 | (1) |
|
Available Projects Viewer |
|
|
397 | (1) |
|
|
|
398 | (8) |
|
Changing General Settings |
|
|
406 | (1) |
|
|
|
407 | (7) |
|
|
|
414 | (1) |
|
|
|
415 | (4) |
|
|
|
419 | (1) |
|
|
|
420 | (1) |
|
Deploying the Application |
|
|
421 | (3) |
|
|
|
424 | (1) |
|
|
|
425 | (44) |
|
|
|
425 | (1) |
|
|
|
426 | (2) |
|
|
|
428 | (3) |
|
|
|
431 | (9) |
|
|
|
440 | (5) |
|
Viewing and Rating Stories |
|
|
445 | (6) |
|
|
|
451 | (6) |
|
|
|
457 | (4) |
|
Creating Your Search Engine |
|
|
461 | (6) |
|
|
|
467 | (2) |
|
APPENDIX A Web Site Design |
|
|
469 | (30) |
|
|
|
469 | (2) |
|
|
|
471 | (3) |
|
|
|
474 | (5) |
|
Start Building the Stylesheet |
|
|
479 | (2) |
|
Formatting the Main <div> Items |
|
|
481 | (6) |
|
|
|
487 | (2) |
|
Creating a Frequently Asked Questions Page |
|
|
489 | (3) |
|
|
|
492 | (3) |
|
|
|
495 | (4) |
| Index |
|
499 | |
Excerpts
Foreword Foreword Listen to podcasts by Jono Bacon and friends at LUG Radio ( http://www.lugradio.org ) and you get a sense of both the spirit and thoughtfulness Jono brings to the open source community. At one moment they speak seriously about hurdles in contributing code to free software projects, while the next they offer a Monty Python-like discussion on which Linux distribution each of them most resembles. Practical PHP and MySQLreflects Jono's commitment to the spirit of making open source subjects accessible to everyone. The book carefully walks you through the code for eight useful, dynamic Web applications. Projects are presented in a playful way, like the forum project that touts horror movies that make you "hide behind the couch." And everything in the book can be run live, modified, saved, and reused from the included live CD. Although the tools you need to create Web content are readily available from the open source community, having a skillful guide like Jono Bacon to help you create dynamic Web applications from those tools is a real treat. The results form a foundation for developing your own blogs, forums, shopping carts, and other Web destinations that should significantly cut your startup time. I am thrilled to have Jono Bacon'sPractical PHP and MySQLas one of the first books in the Negus Live Linux Series. Its content perfectly suits the goals of the series to put quality free and open source software covering various topics into peoples' hands so they can quickly get high-quality results. I hope you enjoy learning from this book as much as I have. --Christopher Negus Series Editor, Negus Live Linux Series Copyright Pearson Education. All rights reserved.