[PHP] Re: form action problem From: Adam (adam <email protected>)
Date: 07/10/01

> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>