[eluser]Christoffer[/eluser]
Hey,
I am building a search function and I need to create easy to read URLs for bookmarks etc. This is a Swedish application first which means we need to support some special characters (å, ä, ö) that are not supported in URLs.
Therefore I need to encode the variable before it's posted to the user. The PHP function rawurlencode() works when I print the variable with echo() but neither redirect() nor header("Location: x") uses the encoded value.
Why is this and how can I work around it?
Code:
<?php
// THIS WORKS!: echo rawurlencode((string)$query);
$keyword = rawurlencode((string)$query);
// This won't
redirect('/search/' . $keyword );
?>
Thank you!