> Hey, thanks for the reply. But I have multiple functions on one page
(and
> I need to keep it that way, because of all the variables I'm passing
> around between them), so I can't just have the link call a new php
file. I
> need it to somehow call a function within the page.

Okay, do you understand, though, that PHP is server side and the browser
is client side. PHP happens first, to generate the HTML code, that's
evaluated in the browser on the client side. Once PHP generates the HTML
code, it can't do anything else. It will take another page refresh or
request to invoke PHP again.

That being said, in your href link, pass an ID saying which function to
call. It can be the name of the function, or a number to relate to it.
Make the action of the page the current page.

Maybe something like this is what you're after??

<?
switch($_GET['ID'])
{
  case 1:
    echo function_one();
    break;
  case 2:
    echo function_two();
    break;
  default:
    echo "<a href='" . $_SERVER['SCRIPT_NAME'] . "?ID=1'>Run Function
One</a>";
    echo "<a href='" . $_SERVER['SCRIPT_NAME'] . "?ID=2'>Run Function
Two</a>";
}
?>

---John Holmes...




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

Reply via email to