if(isset($_POST)) { // do work } if (!empty($_POST)) { // do work }
But it is much better to check the server parameter. There are pretty much information stored in $_SERVER.
if ($_SERVER["REQUEST_METHOD"] == "POST") { { // now we are pretty sure for the post action }
Request method is just more rock solid way to check is a form submitted or not.
No comments:
Post a Comment