Textbook Assignment
Overview
To further enhance my knowledge of PHP, I purchased a copy of Larry Ullman's PHP and MySQL for Dynamic Web Sites. I read the first 3 chapters of the book, and recreated various example programs from the text to practice what I learned. Please use the back button on your browser to return to this page after viewing each program.
Chapter 1
Chapter 1 provided a review of the fundamentals of PHP, such as syntax, variables, concatenation, functions, and constructs. Included from the chapter is the simple
numbers.php script, which calculates the total cost of an order of 30 widgets, based on the unit price of $119.95 and tax rate of 5%.
Chapter 2
Chapter 2 moved on from fundamentals to more programming concepts such as arrays, conditionals, loops, and operators. This chapter taught me how to apply those concepts to create HTML forms that use PHP to generate responses based on the user's form input. Included from the chapter is a simple
HTML Form that uses PHP to generate a response based on the user's name, gender, and email address.
Chapter 3
In Chapter 3, I learned how to include multiple files in a PHP script and advanced form handling. Included from the chapter is a
calculator script that includes a header and footer file. The calculator determines the estimated cost and time of a trip based on gas prices, length of the trip, and fuel efficiency of the car.