a little off topic but.......
in PHP i am building a link, actually two links; one to do a "sort high to low" and another to do a "sort low to high"
a user could have selected multiple filter settings which are contained in the querystring. what i'm trying to do is create my two links and if the user selects "hi to low" i add "ORDER=htl" to the querystring and if they select "low to hi" i add "ORDER=lth" - easy enough. the problem i'm having is....let's say they select "hi to low" and then decide to go back, so they select "low to hi" - i end up with BOTH in the querystring. what i decided to do was a simple str_replace to wipe out any pre-existing lo-to-hi or -hi-to-lo sorts in the querystring. but my code is never removing the pre-existing item(s).
here it is:
<?php
// - begin edit to add price sort hi to low / low to
$strDomain = "<a href = 'http://www.mysite.com?";
$strQueryString = $_SERVER['QUERY_STRING'];
$strNewURL = str_replace("&pORDER=htl", "", $strQueryString); <------seems to never happen
$strNewURL = str_replace("&pORDER=lth", "", $strQueryString); <------seems to never happen
$strURL = $strDomain.$strNewURL;
$dosorturl = $strURL . "&pORDER=htl'>H->L</a>";
$dosorturl2 = $strURL . "&pORDER=lth'>L->H</a>";
echo " sort: " . $dosorturl . "|" . $dosorturl2;
?>
any idea why this doesn't remove any pre-existing instances of "&pORDER=htl" or "&pORDER=lth" ???