Not sure if I'm echoing the function correctly...
<a href="<?php if($order == "act" && $sort == "ASC"){
echo add_or_change_parameter("order", "act", "sort", "DESC", "page", "1");
}else{
echo add_or_change_parameter("order", "act", "sort", "ASC", "page", "1");} ?>">Active/Inactive</a>
Here is the function:
<?php
function add_or_change_parameter($parameter, $value)
{
$params = array();
$output = "?";
$firstRun = true;
foreach($_GET as $key=>$val)
{
if($key != $parameter)
{
if(!$firstRun)
{
$output .= "&";
}
else
{
$firstRun = false;
}
$output .= $key."=".urlencode($val);
}
}
if(!$firstRun)
$output .= "&";
$output .= $parameter."=".urlencode($value);
return htmlentities($output);
}
?>
The get statements are there... it seems the echoing of the function only returns the first result (in this case: order=act)
also, a part of the query ...ORDER BY $order $sort
Again, thanks for any help in advance!