Form Submission multiple forms on page...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rhyno
Forum Newbie
Posts: 1
Joined: Thu Jan 29, 2009 2:50 pm

Form Submission multiple forms on page...

Post by rhyno »

Hello I am writing a cms system for a kennel and am relatively new to php...
I have an edit.php page, which has multiple forms on it.

Code: Select all

<form action="'.$page.'" method="get" name="xxx1">
and

Code: Select all

<form action="'.$page.'" method="get" name="edit1">
$page is calling the edit.php page again.

My question is how can I check to see if the form edit1 was submitted. I know it must be simple but I can not guess what the answer is....

Can you please refresh my memory a bit.
Thank
-Rhyno
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Form Submission multiple forms on page...

Post by requinix »

You can add a hidden input field to each form, like

Code: Select all

<form action="'.$page.'" method="get" name="xxx1">
<input type="hidden" name="form" value="xxx1">
 
<form action="'.$page.'" method="get" name="edit1">
<input type="hidden" name="form" value="edit1">
User avatar
sergio-pro
Forum Commoner
Posts: 88
Joined: Sat Dec 27, 2008 12:26 pm

Re: Form Submission multiple forms on page...

Post by sergio-pro »

You should already have inputs for that:

Code: Select all

 
 
<form action="'.$page.'" method="get" name="xxx1">
<input type="submit" name="form1" value="Save Form A">
 
<form action="'.$page.'" method="get" name="edit1">
<input type="submit" name="form2" value="Save Form B">
 
 
Post Reply