Re: HTACCESS - can you duplicate a line?
Posted: Fri Oct 17, 2014 8:14 am
These links don't work.
When we choose A-Z for example, it doesn't update $order and put it in a sessionm it keeps it set to price1 ASC.
I don't think it's the code that's wrong, it's something within HTACCESS, as I don't believe it is even passing it through to the page, the final but of the URL to give it the Order instruction.
When we choose A-Z for example, it doesn't update $order and put it in a sessionm it keeps it set to price1 ASC.
I don't think it's the code that's wrong, it's something within HTACCESS, as I don't believe it is even passing it through to the page, the final but of the URL to give it the Order instruction.
Code: Select all
RewriteRule ^categ/([0-9]+) /index.php?page=categ&c=$1 [L]
RewriteRule ^categ/([0-9]+)/([^/]+) /index.php?page=categ&c=$1&cname=$2 [L]
RewriteRule ^categ/page/([0-9]+)/([^/]+)/([0-9]+) /index.php?page=categ&c=$1&cname=$2&pagenum=$3 [L]Code: Select all
if (!isset($_REQUEST['order']))
{
$order = "price1 ASC";
}
else if (isset($_REQUEST['order'])) {
$order = $_REQUEST['order'];
$_SESSION['order'] = $_REQUEST['order'];
} else if (isset($_SESSION['order'])) {
$order = $_SESSION['order'];
}
echo "<div class='";
if(isset($order))
{
if ($order == "title ASC") { echo "categ_subcategon";}
else
{
echo "categ_subcateg";
}
}
echo "'><a href='/categ/$c/$categreplace&order=title ASC' style='text-decoration: none'>A-Z</a></div>";
echo "<div class='";
if(isset($order))
{
if ($order == "title DESC") { echo "categ_subcategon";}
else
{
echo "categ_subcateg";
}
}
echo "'><a href='/categ/$c/$categreplace&order=title DESC' style='text-decoration: none'>Z-A</a></div>
<div class='";
if(isset($order))
{
if ($order == "price1 ASC") { echo "categ_subcategon";}
else
{
echo "categ_subcateg";
}
}
echo "'><a href='/categ/$c/$categreplace&order=price1 ASC' style='text-decoration: none'>Price (Low-High)</a></div>
<div class='";
if(isset($order))
{
if ($order == "price1 DESC") { echo "categ_subcategon";}
else
{
echo "categ_subcateg";
}
}
echo "'><a href='/categ/$c/$categreplace&order=price1 DESC' style='text-decoration: none'> (High-Low)</a></div><div style='clear: both; width: 500px'/></div><br/>";
echo "$order<div style='clear: both' /></div>";