O'Reilly logo

Core PHP Programming, Third Edition 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

7.5. 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 someone clicks the submit button in a form, PHP turns each form field into an element of the _REQUEST array. PHP creates them as if you had written the PHP code yourself. 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. This allows you to send arrays in form fields, as discussed later ...

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