Coding / PHP
PHP: Multiple submit button choices in a single FORM
From the original blog archive. Some images and downloads are no longer available. The article retains its original date.
This one is just posted mainly for a friend. He did not understand how to process data differently depending on the submit button clicked, only using ONE HTML FORM. Many people would end up making multiple forms on one or many pages to solve this, which can get rather messy or annoying.
There is a simple way to handle this though using PHP. Take this example:
You can see the above in action HERE! As you see, it is a SIMPLE process that will recognize what button you click with very little coding. Using this method, you can process data differently in one simple form! Easy!
In the next few days I'll probably be working on a small login system that Leigh, a friend of mine requested too. If you also wish for any help/ideas feel free to leave a post or comment and I can normally whip up something within a day or two if it's a small thing.
There is a simple way to handle this though using PHP. Take this example:
You can see the above in action HERE! As you see, it is a SIMPLE process that will recognize what button you click with very little coding. Using this method, you can process data differently in one simple form! Easy!
In the next few days I'll probably be working on a small login system that Leigh, a friend of mine requested too. If you also wish for any help/ideas feel free to leave a post or comment and I can normally whip up something within a day or two if it's a small thing.