O'Reilly logo

Core PHP Programming: Using PHP to Build Dynamic Web Sites by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting Input from Forms

Sending text to the browser is easy to understand. Getting input from forms is a little tricky. HTML offers several ways to get information from the user via forms. There are text fields, text areas, selection lists, and radio buttons among others. Each of these becomes a string of text offered to the Web server when the user clicks the submit button.

When a form is submitted, PHP turns each form field into a variable. The variables created this way are like any other variable. You may even change their values. They are created as if you had written the PHP code to put values into the variables. This means that if you put two form variables on a page with the same name, the second one may overwrite the value of the first. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required