O'Reilly logo

PHP for Teens by Maneesh Sethi

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

Using PHP and Forms

So far we have looked at the basics of entering items on a form and submitting it to another page that utilizes PHP and deals with the inputs. However, you may not want to have to submit the information to another page. In cases like this you can have the PHP form submit the data to itself: The same page that loads takes in the data and uses it for calculations. This can be useful when you want the user’s input to change the page onscreen.

I have used this myself when developing a web site. On one page, the user was allowed to enter a code to make the item cheaper. I didn’t want the page to submit the code data to another page, because that would require multiple pages with almost entirely identical content. Instead, I developed ...

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