Textbook Assignment

For this assignment I read chapters 1-3 of PHP and MySQL for Dynamic Web Sites.

Chapter 1

Introduction to PHP

This chapter covered basic programming theory and syntax for PHP. Below you will see a program that demonstrates that values enclosed in single quotes are treated as literal and those in double quotes are interpreted. Clicking the code below will open a new window with the code executed so you can compare the code to the results.

Image

Chapter 2

Programming with PHP

This chapter I learned about how to create HTML forms and make simple programs using conditional operators and some simple error handling. Below is a sample of a program that checks that all elements have values. If you forget to fill out one of the requred values you will see an error message printed.

Image

Chapter 3

Creating Dynamic Web Sites

In this chapter one of the lessons I learned was how to create a sticky form. This is a form that remembers what a user input incase they need to resubmit it. Below you will see the PHP code to get this effect.

Image