Synopses & Reviews
If you know HTML, this guide will have you building interactive websites quickly. You'll learn how to create responsive, data-driven websites with PHP, MySQL, and JavaScript, regardless of whether you already know how to program. Discover how the powerful combination of PHP and MySQL provides an easy way to build modern websites complete with dynamic data and user interaction. You'll also learn how to add JavaScript to create rich Internet applications and websites.
Learning PHP, MySQL, and JavaScript explains each technology separately, shows you how to combine them, and introduces valuable web programming concepts, including objects, XHTML, cookies, and session management. You'll practice what you've learned with review questions in each chapter, and find a sample social networking platform built with the elements introduced in this book.
This book will help you:
- Understand PHP essentials and the basics of object-oriented programming
- Master MySQL, from database structure to complex queries
- Create web pages with PHP and MySQL by integrating forms and other HTML features
- Learn about JavaScript, from functions and event handling to accessing the Document Object Model
- Use libraries and packages, including the Smarty web template system, PEAR program repository, and the Yahoo! User Interface Library
- Make Ajax calls and turn your website into a highly dynamic environment
- Upload and manipulate files and images, validate user input, and secure your applications
Synopsis
If you know HTML, this guide will have you building interactive websites quickly. You'll learn how to create responsive, data-driven websites with PHP, MySQL, and JavaScript, regardless of whether you already know how to program. Discover how the powerful combination of PHP and MySQL provides an easy way to build modern websites complete with dynamic data and user interaction. You'll also learn how to add JavaScript to create rich Internet applications and websites.
Learning PHP, MySQL, and JavaScript explains each technology separately, shows you how to combine them, and introduces valuable web programming concepts, including objects, XHTML, cookies, and session management. You'll practice what you've learned with review questions in each chapter, and find a sample social networking platform built with the elements introduced in this book.
This book will help you:
- Understand PHP essentials and the basics of object-oriented programming
- Master MySQL, from database structure to complex queries
- Create web pages with PHP and MySQL by integrating forms and other HTML features
- Learn about JavaScript, from functions and event handling to accessing the Document Object Model
- Use libraries and packages, including the Smarty web template system, PEAR program repository, and the Yahoo! User Interface Library
- Make Ajax calls and turn your website into a highly dynamic environment
- Upload and manipulate files and images, validate user input, and secure your applications
Synopsis
A simple, streamlined guide for non-programmers who want to create responsive, data-driven websites with easy-to-use open source tools. PHP and MySQL remain the top combination for developing modern websites with dynamic data and user interaction. Once you add JavaScript, you have Ajax -- the framework behind many popular Internet destinations. This concise, understandable guide teaches non-programmers and web designers how to use these powerful tools quickly and easily. The book also introduces Apache and XHTML.
About the Author
Robin Nixon has worked with and written about computers since the early 1980s (his first computer was a Tandy TRS 80 Model 1 with a massive 4KB of RAM!). One of the web sites he developed presented the world's first radio station licensed by the music copyright holders. In order to enable people to continue to surf while listening, Robin also developed the first known pop-up windows. He has also worked full time for one of Britain's main IT magazine publishers, where he held several roles including editorial, promotions, and cover disc editing.
Table of Contents
Preface; Audience; Assumptions This Book Makes; Organization of This Book; Supporting Books; Conventions Used in This Book; Using Code Examples; We'd Like to Hear from You; Safari® Books Online; Acknowledgments; Chapter 1: Introduction to Dynamic Web Content; 1.1 HTTP and HTML: Berners-Lee's Basics; 1.2 The Benefits of PHP, MySQL, and JavaScript; 1.3 The Apache Web Server; 1.4 About Open Source; 1.5 Bringing It All Together; 1.6 Test Your Knowledge: Questions; Chapter 2: Setting Up a Development Server; 2.1 What Is a WAMP, MAMP, or LAMP?; 2.2 Installing a WAMP on Windows; 2.3 Installing a MAMP on Mac OS X; 2.4 Installing a LAMP on Linux; 2.5 Working Remotely; 2.6 Using a Program Editor; 2.7 Using an IDE; 2.8 Test Your Knowledge: Questions; Chapter 3: Introduction to PHP; 3.1 Incorporating PHP Within HTML; 3.2 This Book's Examples; 3.3 The Structure of PHP; 3.4 Test Your Knowledge: Questions; Chapter 4: Expressions and Control Flow in PHP; 4.1 Expressions; 4.2 Operators; 4.3 Conditionals; 4.4 Looping; 4.5 Implicit and Explicit Casting; 4.6 PHP Dynamic Linking; 4.7 Test Your Knowledge: Questions; Chapter 5: PHP Functions and Objects; 5.1 PHP Functions; 5.2 Including and Requiring Files; 5.3 PHP Version Compatibility; 5.4 PHP Objects; 5.5 Test Your Knowledge: Questions; Chapter 6: PHP Arrays; 6.1 Basic Access; 6.2 The foreach...as Loop; 6.3 Multidimensional Arrays; 6.4 Using Array Functions; 6.5 Test Your Knowledge: Questions; Chapter 7: Practical PHP; 7.1 Using printf; 7.2 Date and Time Functions; 7.3 File Handling; 7.4 System Calls; 7.5 XHTML; 7.6 Test Your Knowledge: Questions; Chapter 8: Introduction to MySQL; 8.1 MySQL Basics; 8.2 Summary of Database Terms; 8.3 Accessing MySQL via the Command Line; 8.4 Indexes; 8.5 MySQL Functions; 8.6 Accessing MySQL via phpMyAdmin; 8.7 Test Your Knowledge: Questions; Chapter 9: Mastering MySQL; 9.1 Database Design; 9.2 Normalization; 9.3 Relationships; 9.4 Transactions; 9.5 Using EXPLAIN; 9.6 Backing Up and Restoring; 9.7 Test Your Knowledge: Questions; Chapter 10: Accessing MySQL Using PHP; 10.1 Querying a MySQL Database with PHP; 10.2 A Practical Example; 10.3 Practical MySQL; 10.4 Test Your Knowledge: Questions; Chapter 11: Form Handling; 11.1 Building Forms; 11.2 Retrieving Submitted Data; 11.3 An Example Program; 11.4 Test Your Knowledge: Questions; Chapter 12: Templating with Smarty; 12.1 Why Smarty?; 12.2 Installation; 12.3 Creating Scripts; 12.4 Creating Templates; 12.5 A Practical Example; 12.6 Test Your Knowledge: Questions; Chapter 13: Cookies, Sessions, and Authentication; 13.1 Using Cookies in PHP; 13.2 HTTP Authentication; 13.3 Using Sessions; 13.4 Test Your Knowledge: Questions; Chapter 14: Exploring JavaScript; 14.1 JavaScript and HTML Text; 14.2 Using Comments; 14.3 Semicolons; 14.4 Variables; 14.5 Operators; 14.6 Variable Typing; 14.7 Functions; 14.8 Global Variables; 14.9 The Document Object Model; 14.10 Test Your Knowledge: Questions; Chapter 15: Expressions and Control Flow in JavaScript; 15.1 Expressions; 15.2 Operators; 15.3 The with Statement; 15.4 Using onError; 15.5 Using try...catch; 15.6 Conditionals; 15.7 Looping; 15.8 Explicit Casting; 15.9 Test Your Knowledge: Questions; Chapter 16: JavaScript Functions, Objects, and Arrays; 16.1 JavaScript Functions; 16.2 JavaScript Objects; 16.3 JavaScript Arrays; 16.4 Test Your Knowledge: Questions; Chapter 17: JavaScript and PHP Validation and Error Handling; 17.1 Validating User Input with JavaScript; 17.2 Regular Expressions; 17.3 Redisplaying a Form After PHP Validation; 17.4 Test Your Knowledge: Questions; Chapter 18: Using Ajax; 18.1 What Is Ajax?; 18.2 Using XMLHttpRequest; 18.3 Test Your Knowledge: Questions; Chapter 19: Using YUI for Ajax and More; 19.1 Choosing a Framework; 19.2 Using YUI; 19.3 Other Uses for YUI; 19.4 Test Your Knowledge: Questions; Chapter 20: Bringing It All Together; 20.1 Designing a Social Networking Site; 20.2 On the Website; 20.3 rnfunctions.php; 20.4 rnheader.php; 20.5 rnsetup.php; 20.6 index.php; 20.7 rnsignup.php; 20.8 rnsignup.php (YUI version); 20.9 rncheckuser.php; 20.10 rnlogin.php; 20.11 rnprofile.php; 20.12 rnmembers.php; 20.13 rnfriends.php; 20.14 rnmessages.php; 20.15 rnlogout.php; Solutions to the Chapter Questions; Chapter 1 Answers; Chapter 2 Answers; Chapter 3 Answers; Chapter 4 Answers; Chapter 5 Answers; Chapter 6 Answers; Chapter 7 Answers; Chapter 8 Answers; Chapter 9 Answers; Chapter 10 Answers; Chapter 11 Answers; Chapter 12 Answers; Chapter 13 Answers; Chapter 14 Answers; Chapter 15 Answers; Chapter 16 Answers; Chapter 17 Answers; Chapter 18 Answers; Chapter 19 Answers; Online Resources; PHP Resource Sites; MySQL Resource Sites; JavaScript Resource Sites; Ajax Resource Sites; Miscellaneous Resource Sites; O'Reilly Resource Sites; MySQL's FULLTEXT Stopwords; MySQL Functions; String Functions; Date Functions; Time Functions; Using PEAR and PHPUnit; Installation; Creating a Connect Instance; Rewriting to Use PEAR; Adding Other PEAR Packages; Unit Testing with PHPUnit; Colophon;