Re: form action problem

From: Date: Tue, 10 Jul 2001 10:33:40 +0000
Subject: Re: form action problem
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-57126@lists.php.net to get a copy of this message
> hmm....do again as: > > <? > function functionA() > { > // your function goes here.... > } > > if (isset($usefunctiona)) > { > functionA(); > } > ?> > > <html> > <body> > <form name="form1" method="post" > action="<?=$PHP_SELF?>" > > <input type="submit" name="usefunctiona" value="Use > functionA"> > </form> > </body> > </html> i might try: <?php function a() { //same idea put function here } function b() { //same idea put function here } if (!empty($func_a)) { a($field1); //this would assume you have passed a variable in the form to use in the function. }else if (!empty($func_b)) { b($field1); } ?> <form name="form1" method="post" action="<?php echo $PHP_SELF ?>" > <input type="text" name="field" value="insert value to be processed by function"> <input type="submit" name="func_a" value="true"> </form> this would also assume you need multiple functions to be used on the same form as submit buttons. This seems like the most logical/simple way to do it. -Adam

« previous php.general (#57126) next »