Change this code:
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"ordersResu lts_500");
}
to:
if ($WAFV_Errors != "") {
if(isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "") {
// array of QS variable names to remove //
$arrRemove = array();
$arrRemove[] = "Search";
$arrRemove[] = "Search_x";
$arrRemove[] = "Search_y";
$arrRemove[] = "Search.x";
$arrRemove[] = "Search.y";
$arrQS = explode("&", $_SERVER["QUERY_STRING"]);
foreach($arrQS as $k => $v) {
$arrVar = explode("=", $v);
if(in_array($arrVar[0], $arrRemove)) unset($arrQS[$k]);
}
if(sizeof($arrQS) > 0) {
$_SERVER["QUERY_STRING"] = "?".implode("&", $arrQS);
}
}
PostResult($WAFV_Redirect,$WAFV_Errors,"ordersResu lts_500");
}