Jordi Canals wrote:
I have a method in a class wich composes an URL from the database,
this method sets some extra params in the url. In this case, the
function returns:

/myaccount/?opt=sys&id=3

Note the & in the URL

Well, with this code, the url works perfect and the & is going as
expected redirecting to /myaccount/?opt=sys&id=3

echo '<a href="'. $url .'">Test URL</a>';

This is correct, you should use entities in html atributes


But when triying


header("Location: $url");

But not in headers

The only solution I've found is to change the code to this:

header('Location: '. html_entity_decode($url));

I would like to know if there is a better way to do it, or something
else I should take into consideration.

Another method in your class that will return unencoded urls.

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



Reply via email to