Skip to content

PHP code snippet – How to check if page is accessed via post?

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Boom baby we a POST method.
}
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// We are a GET method.
}
See also  How to split sting in PHP?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.