Re: Forward slashes and header requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave M G schreef:
Ashley,

Thank you for responding.

best way to fix it was to use
$location = str_replace('//','/', $_SERVER['REQUEST_URI']);

Unfortunately the trim() command I use seems to destroy all slashes anyway, so this doesn't seem to have an impact. Thank you for the suggestion, though.

Anyone have any other ideas?

if (empty($userRequest))
	$userRequest = '/';

header("Location: http://{$serverName}{$userRequest}";);
exit;

note that redirects according to spec must contain an absolute
URI (i.e. including the protocol and domain) ...although with works
nicely in every modern browser.

PS - can't believe I just wrote that given the rant about redirect
I just let loose on the world. oh well, it is a CMS ... different rules
apply ... or I'm just inconsistent or ... well Cumming no doubt has
something to say about it ;-)




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux