How can I find out which method (usually GET or POST) is used for the current request?
+11
A:
$_SERVER['REQUEST_METHOD']
See the docs. It will contain the request method upper-cased (i.e. 'GET', 'HEAD', 'POST', 'PUT').
Dominic Rodger
2009-10-08 14:13:36
A:
if (isset($_SERVER['HTTP_METHOD'])) {
print $_SERVER['HTTP_METHOD'];
}
Andrew Sledge
2009-10-08 14:13:56
I can't find any reference to that key on http://us3.php.net/manual/en/reserved.variables.server.php
Dominic Rodger
2009-10-08 14:17:07