Jump to content

Confuscious He say: Excuse me...


rwwd

Recommended Posts

Can someone confirm for me this: All data in $_GET || $_POST is technically a string; I know this to be true DEFINITELY for $_POST array, but I'm not too sure on $_GET and I cannot find a reference to this on the manual, so I am assuming that I should treat it exactly the same as $_POST; the thing I do know is that $_GET is automatically sent through urlencode() hence, if you apply urlencode() to the $_GET array() you will get some unexpected results.

 

Just to note, this is for information only, something I have always assumed/presumed true, so I thought I would ask some black belt php 'grammers.

 

Hmm, if I had a beard I would be stroking it in a stance of deep thought right now...

 

Rw

Link to comment
https://forums.phpfreaks.com/topic/214217-confuscious-he-say-excuse-me/
Share on other sites

PHP will put arrays in $_POST as well, such as in this thread: http://www.phpfreaks.com/forums/index.php/topic,310848.0.html

 

But if it's not an array then yes, i'ts a string.  That's the same for $_GET and $_POST.  PHP will urldecode() $_GET data automatically for you, so it arrives ready to use.  Did you mean urldecode() or urlencode()?

Did you mean urldecode() or urlencode()?

 

Um, yes, typo, the former not the latter. Thanks for the explanation, I always wonder, but I treat $_GET just like $_POST, I would rather be safe than sorry, and so far, no problems, I did have a piece of wood here somewhere too..

 

Rw

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.