Php decoding querystrings

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Wootah
Forum Newbie
Posts: 13
Joined: Wed Jul 14, 2010 7:08 pm

Php decoding querystrings

Post by Wootah »

Hi all,

I have recently learnt that php decodes a query string automatically. Is there a way to disable this feature for a webpage?

So when you write code like:

Code: Select all

	$account = $_REQUEST["account"];
There is an automatic decode($account); that occurs.

This is probably a very good thing but in my current situation it is not desirable. What is the best way to get the querystring data 'as is'?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Php decoding querystrings

Post by Christopher »

You may want to parse $_SERVER["QUERY_STRING"] manually with parse_url() (I think parse_str() will decode).
(#10850)
Post Reply