basically, when u submit the form, just send a hidden variable such as this:
<form method="post" action="<? echo($php_self); ?>">
<input type="hidden" name="mode" value="function">
then, when you submit the form, the page will refresh the variable "mode" will be set.
So, now, you just do an if statement like this:
if ($mode == "function") {
functionname();
}
else {
//run the rest of the page, or the form, or whatever
}