Re: Re: Best way to test for form submission?
| From: | Ben Dunlap | Date: | Fri, 28 Aug 2009 16:59:57 +0000 |
| Subject: | Re: Re: Best way to test for form submission? | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-297436@lists.php.net to get a copy of this message | ||
> Well, as far as I'm aware $_SERVER isn't reliable from server to server.
> That said, I've never had a problem using it.
Thanks -- I just looked it up and the manual says: "There is no
guarantee that every web server will provide any of these; servers may
omit some, or provide others not listed here. That said, a large
number of these variables are accounted for in the » CGI 1.1
specification, so you should be able to expect those."
So I guess it wouldn't make sense to rely on anything in $_SERVER if
you're building an app for widespread use; e.g., CodeIgniter, as
mentioned above.
> tend to use the $_REQUEST array instead of $_POST or $_GET. You get the
> benefit of being able to work with both arrays (as well as $_SESSION and
> $_COOKIE) without any drawbacks.
For now I'm inclined against $_REQUEST, since it's not yet supported
by filter_input(). I think filter_input() is the bee's knees and I've
stopped touching $_POST or $_GET directly since I discovered it.
Ben