URLENCODE doesn't work |
[eluser]Ludatha[/eluser]
For some reason urlencode doesn't work with my codeigniter, a have a script that encodes titles of forum threads so they can be used in the URL, but urlencode is not encoding :O http://ludatha.com/forum/category/Spam Land.html If you go to that website and click one of the threads that have special characters in them, it will say 404 not found, or Disallowed Key Characters... The function urlencode does work on my server as I made a test script to test it http://ludatha.com/test/testencode.php It encodes fine So here comes my code Function:createURI Code: function createURI($id, $string, $place, $total = TRUE){ This is the code used to get the latest thread Code: $latestThread = $latestPostRow->name; Can anyone help?
[eluser]BrianDHall[/eluser]
I suspect the problem is str_replace - comment out the other code and immediately after using the replace, var_dump the $string. Then var_dump again after url-encoding and this should shed some light on what in sweet hell is going on in there.
[eluser]Ludatha[/eluser]
[quote author="BrianDHall" date="1253949491"]I suspect the problem is str_replace - comment out the other code and immediately after using the replace, var_dump the $string. Then var_dump again after url-encoding and this should shed some light on what in sweet hell is going on in there.[/quote] I tried that, and the outcome I got was actually url encoded... I don't understand... I viewed the source of the page and the URL was actually <a href="http://ludatha.com/forum/post/97-!"> (EDIT: there was a load of encoded characters here, but this forum has removed them all...) But when I click on it the url changes back to the original, so I get the uri disallowed characters error. Also when I hover over the link, the status bar shows the original link... Can anyone help me? |
Welcome Guest, Not a member yet? Register Sign In |