Choosing between $_POST & $_GET and not returning Notice

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

aliasxneo
Forum Contributor
Posts: 136
Joined: Thu Aug 31, 2006 12:01 am

Post by aliasxneo »

Personally I always try to use $_POST or $_GET whenever possible, but I do often times use $_REQUEST. There's really no problem with using it as long as you verify the data, as you should do with $_POST and $_GET. Always verify external data, that's like the first rule of security with PHP. So whether you use $_POST, $_GET, or $_REQUEST should not matter unless you're using cookies in which case things could get messy.

If you're truly against $_REQUEST then as stated before using $_SERVER['REQUEST_METHOD'] would be another good option though you should know where your data is coming from, if you have to look for it something's wrong ;)
Post Reply