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  Python code snippet - How do a plot on matplotlib ?

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.