aprestong
10-25-2006, 08:30 PM
I cant figure out why this doesnt work.
I can specify the sort of my returned data from FileMaker by sending a paramater of "ascend" or "descend" -
So, when I try to use GET links to sort my table, I can't seem to get it to switch from descend to ascend (back and forth) by clicking the same link.
Does the error seem apparent to anyone?
I can't seem to get it.
here is my php:
<?php
$sortpref=$_GET['sortpref'];
$sortstyle=$_GET['sortstyle'];
if(!isset($_GET['sortpref']))
{
$sortpref="TimeStamp";
$sortstyle="descend";
}
?>
and here is the HTML (and php) that I'm trying to use for my links:
<tr>
<td><center><b><a href="http://blahblah/admintools.php?sortpref=TimeStamp&sortstyle=
<?php
if($sortstyle = "descend")
{
print "ascend";
}
elseif($sortstyle = "ascend")
{
print "descend";
}?>">TimeStamp</a></b></center></td>
<td><center><b><a href="http://blahblah/admintools.php?sortpref=Username">Username</a></b></center></td>
<td><center><b><a href="http://blahblah/admintools.php?sortpref=WebAccountNumber">WebAccount#</a></b></center></td>
<td><center><b><a href="http://blahblah/admintools.php?sortpref=Browser">Browser</a></b></center></td>
<td><center><b><a href="http://blahblah/admintools.php?sortpref=Version">Version</a></b></center></td>
<td><center><b><a href="http://blahblah/admintools.php?sortpref=Res">Resolution</a></b></center></td>
</tr>
My tests have only been with the first link - - I figured once I got it working I would do the same with the rest.
Does anyone have any thoughts??
I can specify the sort of my returned data from FileMaker by sending a paramater of "ascend" or "descend" -
So, when I try to use GET links to sort my table, I can't seem to get it to switch from descend to ascend (back and forth) by clicking the same link.
Does the error seem apparent to anyone?
I can't seem to get it.
here is my php:
<?php
$sortpref=$_GET['sortpref'];
$sortstyle=$_GET['sortstyle'];
if(!isset($_GET['sortpref']))
{
$sortpref="TimeStamp";
$sortstyle="descend";
}
?>
and here is the HTML (and php) that I'm trying to use for my links:
<tr>
<td><center><b><a href="http://blahblah/admintools.php?sortpref=TimeStamp&sortstyle=
<?php
if($sortstyle = "descend")
{
print "ascend";
}
elseif($sortstyle = "ascend")
{
print "descend";
}?>">TimeStamp</a></b></center></td>
<td><center><b><a href="http://blahblah/admintools.php?sortpref=Username">Username</a></b></center></td>
<td><center><b><a href="http://blahblah/admintools.php?sortpref=WebAccountNumber">WebAccount#</a></b></center></td>
<td><center><b><a href="http://blahblah/admintools.php?sortpref=Browser">Browser</a></b></center></td>
<td><center><b><a href="http://blahblah/admintools.php?sortpref=Version">Version</a></b></center></td>
<td><center><b><a href="http://blahblah/admintools.php?sortpref=Res">Resolution</a></b></center></td>
</tr>
My tests have only been with the first link - - I figured once I got it working I would do the same with the rest.
Does anyone have any thoughts??