willaguila Posted July 20, 2009 Share Posted July 20, 2009 I'm testing urlencode to code the characters below and in the source produced by the page it is encoded correctly, but when I click the made up link I get this in my url: http://localhost/php_sandbox/"bad"22%2F<>character%24 As you can see the "" and <> are not encoded, any idea why this happens? Using Apache 2 php 5.2.9 <?php $param2 = '"bad"/<>character$'; $test = urlencode($param2); ?> <br/> <a href="<?php echo htmlspecialchars($test); ?>" >test</a> Link to comment https://forums.phpfreaks.com/topic/166661-urlencode-question/ Share on other sites More sharing options...
rhodesa Posted July 20, 2009 Share Posted July 20, 2009 use rawurlencode() instead Link to comment https://forums.phpfreaks.com/topic/166661-urlencode-question/#findComment-878810 Share on other sites More sharing options...
willaguila Posted July 20, 2009 Author Share Posted July 20, 2009 well its my understanding the when dynamically generating urls, anything after the "some.php?" shoulde be urlencode and anything before the ? should be rawencode. I did forget to mention that it works fine in IE but it is Firefox 3. giving me the issue. Link to comment https://forums.phpfreaks.com/topic/166661-urlencode-question/#findComment-878854 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.