In your hyperlink you need to pass the name of the function you are wanting to run. Ignore javascript here - there is a similar way using javascript, but no point.
If your functions are in the same script as the one which has just produced the HTML page, then you would simply omit the script name to re-load the same script.
So each of your href links would look something like:
<a href="?func=sortbyname">
<a href="?func=sortbydate">
etc.
Your PHP script then has to check for the existance of a value for the variable $func everytime it runs.
Locate the code which outputs your table of data to the HTML page. Just before this you need to sort your data into the right order by calling one of your functions, such as "sortbyname". To do this.
if($func) {
eval($func.'()');
}
This code will call the function which you named in the $func variable. Should you need to pass parameters you can specify these in the URL and remove the .'()' form the eval() call. You should know what to do I guess! It's easy... ;o)
When the function returns your data will be in the order that the function puts it in (however you are doing this) and ready to output in to HTML.
Hope that works - works for me here :-)