SyntaxFix
Write A Post
Hire A Developer
Questions
By using
$_SERVER['REQUEST_METHOD']
if ($_SERVER['REQUEST_METHOD'] === 'POST') { // The request is using the POST method }
For more details please see the documentation for the $_SERVER variable.