The Web today is an increasingly dynamic environment. PHP, in conjunction with the database MySQL, is the leading technology used to build millions of dynamic Web sites.
In this six-lesson class, you'll learn how to develop dynamic Web site features using PHP and MySQL. Working step-by-step, you'll learn how to: set up and configure a Web site and development site for PHP development; design and build a MySQL database and write basic SQL queries; write basic PHP scripts to collect and process information from forms, troubleshoot and fix common PHP scripting errors; write scripts to store information in a database; and display dynamic information on multiple pages within a site.
The course provides a broad foundation in Web site development using PHP and MySQL. Course assignments focus on learning how to correctly write scripts and queries and building functional forms. By the end of the course, you'll create an online catalogue that displays product information pulled from a database. Working with renowned PHP expert Janet Valade, you'll build a foundation for developing online customer accounts, mailing lists, user polls, forums, shopping carts, and more.
Important: This course is quite technically challenging. Students entering this class should have a strong experience and comfort with hand-coding HTML and CSS and experience with basic site development in Adobe Dreamweaver.
In Lesson One, you'll learn the basics of how dynamic sites work. You'll explore the differences between static and dynamic sites and the benefits of using PHP and MySQL. You'll learn how to add PHP code to a Web site, and examine how PHP files are processed by a server. To prepare you for PHP development, you'll learn how to install your development environment (on your Mac or PC), and make existing sites dynamic in Dreamweaver. You'll write a basic PHP script and configure your Web site and development site for PHP. In the exercise, you'll confirm your development setup and publish a Web page with a PHP script.
Most dynamic Web sites need a backend database. A database contains information that is displayed to users online, such as product information in a catalog. Lesson Two explores how to design, build, and access a MySQL database for a dynamic site. The lesson begins by explaining how MySQL works and showing how to access a MySQL database using a cPanel and phpMyAdmin. Next, you'll explore the basics of database design, learning how to define required information and structure database tables. Using phpMyAdmin, you'll learn to build a database and write SQL queries to add, retrieve, change, and remove data from it, as well as back up the database to your local development environment. In the exercise, you'll design and build a customer information database, and write SQL queries for typical customer information requests.
Lesson Three focuses on the challenge of writing PHP scripts to display dynamic forms. You'll begin by learning how to separate logic and display code in your PHP scripts and comment your code. Then you'll learn how to name, create, and assign PHP variables as well as check their contents and explore how to store information as character strings and numbers and display it using echo statements. In the second half of the lesson, you'll connect what you've learned to more complex forms, learning how to organize scripts using display and logic scripts and how to walk through an array. To combat inevitable scripting errors, you'll learn how to interpret and act upon common PHP error messages. In the exercise, you'll learn PHP syntax by debugging a sample script, and write a script to display a form for your customer information database.
Dynamic Web pages essentially collect information from visitors in HTML forms and respond to that information. Lesson Four discusses how to write scripts to process information submitted in a form, checking its format, and redisplaying the form when information is missing or invalid. During the lesson, you will learn how to use variables and functions to set up conditions and write if statements. Various tasks including comparing values, testing variable content, and pattern matching are discussed and then explored in the context of processing form information. In the exercise, you'll write scripts to test the format of information and write a complete script to process a form.
The database is the center of your dynamic Web site, whether you want to display information from your database on your Web page or store information in your database that you collect in a form. Lesson Five focuses on using PHP to interact with a MySQL database. You'll learn how to set up different levels of user account, using hostnames, passwords, and account privileges, so that you can connect to a MySQL server. You'll discover how to write PHP scripts to store data, protecting yourself against damaging queries. Then you'll explore how to retrieve data from the database and display it, using different kinds of loops and displaying several rows if needed. You'll also focus on the challenge of building dynamic forms—forms whose structure and content is defined by data in a database. In the exercise, you'll build a login application, one of the most fundamental applications used on the Web.