[PHP]
require_once("/users/ppowell/web/php_global_vars .php");
if ($_GET['id']) {
// INITIALIZE VARS
$fileID = @fopen("$userPa th/xml/redirect.xml", 'r');
$stuff = @fread($fileID, @filesize("$use rPath/xml/redirect.xml")) ;
@fclose($fileID );
// XML PARSE
$parser = xml_parser_crea te();
@xml_parse_into _struct($parser , $stuff, $redirectArray, $tags);
@xml_parser_fre e($parser);
/*------------------------------------------------------------------------------------------
This will assume that the entire 3-dim XML-parsed array will have
as its outer key the
same ID value found in the 'id' attribute in the innermost array.
This means you cannot
ever delete any row from redirect.xml unless you renumber!
-------------------------------------------------------------------------------------------*/
$url = $redirectArray[$id]['attributes']['URL'];
if (trim($redirect Array[$id]['attributes']['QUERY_STRING']) !== '?')
$url .= '?';
$url .= preg_replace('/=/i', '=',
$redirectArray[$id]['attributes']['QUERY_STRING']);
$url = preg_replace('/\/$/', '', $url); // REMOVE TRAILING / TO
ACCOMMODATE QUERY STRING AND/OR ANCHOR
if (preg_match('/^http/i', $url)) {
echo "<script type=\"text/javascript\">\n <!--\n location.href=\ "" .
str_replace('"' , '"', $url) . "\";\n //-->\n</script>\n" .
"<noscript><met a http-equiv=\"Refresh \" content=\"0:URL =" .
str_replace('"' , '"', $url) . "\"></noscript>\n";
}
}
[/PHP]
If the URL happens to be this:
http://the-nordic-one.livejournal.co...memory10242006
Instead it winds up looking like this every single time:
http://the-nordic-one.livejournal.co...emory10242006?
I know for a fact that redirect.xml has the correct information:
<pre>
<?xml version="1.0" encoding="utf-8" ?><redirections ><redirection
id="1"
url="http://valsignalandet. com/http://valsignalandet. com/cgi-bin/cgiwrap/ppowell/te
xt.cgi"
query_string="p ath=studies& ;name=madonnacr ucifixion.txt"> </redirection><re direction
id="2" url="http://the-nordic-one.livejournal .com#alchemymem o
ry10242006" query_string="? "></redirection></redirections>
</pre>
But the URL is maligned every single time upon redirection. Is there a
way to prevent this from happening?
Thanx
Phil