Hi,
to correct the url you can do something like:
<?PHP
$url = "http://test.localhost/redirect.php?&&&&&&55555554&&&[url]http://test1.localhost/cable.csv?s=RR&a=8[/url]";
echo $url."<br>\n";
$arrParts = preg_split("§[?&]+§",$url);
$newurl = $arrParts[0];
unset($arrParts[0]);
$newurl .= "?".implode("&",$arrParts);
echo $newurl."<br>\n";
?>
Thomas
Edit: No, that won't work, use urlencode like mentioned by devinemke to urlencode the parameter.