2. Programming with PHP

In This Chapter

Creating an HTML Form 36

Handling an HTML Form 41

Conditionals and Operators 45

Validating Form Data 49

Introducing Arrays 54

For and While Loops 69

Review and Pursue 72

Now that you have the fundamentals of the PHP scripting language down, it’s time to build on those basics and start truly programming. In this chapter you’ll begin creating more elaborate scripts while still learning some of the standard constructs, functions, and syntax of the language.

You’ll start by creating an HTML form, and then learn how you can use PHP to handle the submitted values. From there, the chapter covers conditionals and the remaining operators (Chapter 1, “Introduction to PHP,” presented the assignment, concatenation, ...

Get PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.