You should be able to insert a hidden field in your form and that check
against that in your PHP script to determine which (if any) of your form
was submitted:

<form>
<input type=hidden name=f value=1>
</form>


<form>
<input type=hidden name=f value=2>
</form>


in your script:

<?php

switch ($_POST['f'])
{
        case '1'        :

                // first form

                break;

        case '2'        :

                // second form

                break;

        default:

                // no form
}

That's just one way you can do it. Hopefully it addresses your problem!

Cheers,


Marco
-- 
------------
Marco Tabini
Publisher

php|architect
A Publication of the MTA Group, Inc.
28 Bombay Ave.
Toronto, ON M3H 1B7
Canada

Phone: (416) 630-6202
Fax: (416) 630-5057
--- Begin Message ---
Hi all,

I have an update page that has a form in it.

However, I want to add another form in the same page.  My current form acts
upon itself (i.e. Action = the same page).  If I set up another form to do
the same, how would my PHP determine with action submit button was acted
upon?

Currently, for the single form here is how it knows a form was submitted:

if ((isset($HTTP_POST_VARS["MM_update"])) && ($HTTP_POST_VARS["MM_update"]
== "form1")) {

How would I test which form submitted the action?

Thanks and if I didn't make myself clear, I apologize.

Doug




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to