I have done a table sort via header and its working great, lets me sort by asc and desc everytime user clicks.
<?
if($cnt==0)
{
echo ("<a href=\"race_details.php?race=$race&course=$course&date=$date&sortrow=asc&idct=1&sort=FinishPosition\">FinishPosition</a>");
}
elseif($cnt==1)
{
echo ("<a href=\"race_details.php?race=$race&course=$course&date=$date&sortrow=desc&idct=0&sort=FinishPosition\">FinishPosition</a>");
}
?>
The above is the code. How would I change it so the page link could be <?php echo $_SERVER['PHP_SELF']; ?> instead, as when I put this in a get a error message. and it would be also good if i could include a function for some of the link. So my ideal solution would be.
<a href=\"<?php echo $_SERVER['PHP_SELF']; ?><?php sort_Text()?>&sortrow=desc&idct=0&sort=FinishPosition\">
sort_Text() is the function as it is common code which will be the same on all the links, not necessary but will make code neater.