On 10/12/07, Brian D. <[EMAIL PROTECTED]> wrote: > I can't find where I read it originally, but somewhere I've been told > or read that "using $_REQUEST is bad form." I understand that in cases > where you want to force a $_POST request, but if you might receive > $_GET or $_POST then isn't is better than doing if/elses?
As others have mentioned, it is harder to debug and/or more open to confusion because it combines inputs, and that can sometimes lead to surprising results. It's not that you shouldn't use it, but you should be aware of the potential consequences (POSTed values overwriting GET, COOKIE values overwriting GET and POST) when you do. The semantics of the get and post HTTP methods is different. Get requests are always supposed to be "safe," not making changes to server-side resources. There is no expectation that post requests _must_ be unsafe, but it's kind of implied. Based on that, I think it is good form to pick either get or post for your interface, depending on whether a resource is being updated or not. -- Chris Snyder http://chxo.com/ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php
