php: check if request is GET or POST

Trabla: php: check if request is GET or POST

Solving:

<?php

if ( $_SERVER[ 'REQUEST_METHOD' ] === 'GET' ) {
    // … PROCESS GET REQUEST
}

if ( $_SERVER[ 'REQUEST_METHOD' ] === 'POST' ) {
    // … PROCESS POST REQUEST
}

?>

No comments:

Post a Comment