I want to know how to detect if $_POST is set or not.
Right now I detect it like this:
if(isset($_POST[\'value\']))
But I\'m not lo
I know this answer has already been answered, but here's a simple method I'm using in one of my classes to figure whether the post has been set (perhaps someone will find it useful):
public function isPost($key = null) {
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
return false;
}
if (!empty($key)) {
return isset($_POST[$key]);
}
return true;
}