I am having an issue passing a % sign via the $_GET method. I am running the variable through urlencode() before sending it to the browser and it is adding all the + signs between words but it does nothing with the % and this is causing a 404 error. I have also tried using rawurlencode() but it is the same effect with the error. This is an issue for me as I am coding my own forum and I cannot control if a user uses % instead of percent. Can anyone think of why urlencode() is not encoding the % sign?
The posted code does not have a closing double-quote for the HREF value.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Yes, I know I didnt post the code exactly as it is the html is all there and working fine its the urlencode () that isnt working that is why I asked what else I could do because whenever a user puts a % sign into their post it is not encoded with %25 as it should be.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
ok so it is encoding correctly or so it looks like it when I click the link but for some reason any url with a % in the $_GET variable causing this error:
"Not Acceptable
An appropriate representation of the requested resource /reply.php could not be found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."
For some reason it is only urls with a % in the $_GET variable that are causing this error. Do you have any idea what could be causing this?
Perhaps we need to see the actual PHP code in question? Maybe $message is too long for use in a URL?
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Perhaps we need to see the actual PHP code in question? Maybe $message is too long for use in a URL?
What is the limit? I read that it is over 2000 characters for the lowest limit. When I checked the number of characters in my url that I was passing it was 299. I posted the php that was being used, here is the message that was in the variable.
"Currently the show only measures contestant's success based on % of total body weight lost. Do you think they should measure total body fat percentage? Voice your opinions here."
My suspicion is something in your web server's configuration, perhaps some sort of (misguided?) security setting that does not allow some aspect of that string in a URL? At least, if I send it to a couple other domains, I don't get the "Not acceptable..." error (though of course I get a 404).
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks