Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Builder.com:
Handling Multiple Submits in PHP
Jul 01, 2004 @ 12:18:55

From Builder.com, there's a new posting for anyone out there trying to figure out how to handle multiple submits in the same form.

For those confused, imagine a simple form with one submit button. Simple, easy, clean to code, but limited in functionality. Bring in a few more submit buttons and you get the chance to add more features (Their example is an add/subtract pair of buttons). Their choice for the handling of the submits? A simple switch statement working off of the name of the submit to perform the correct task.

That's all well and good for normal buttons, but what if your form has an image as a submit? Well, they cover that too, checking the X coordinates of the submit to ensure the correct chunk of code is executed.

tagged:

Link:


Trending Topics: