In PHP è semplice filtrare e limitare il tipo di richieste HTTP.
La soluzione è la seguente:
function my_is_valid_http_request_type() {
$allowed = ['GET', 'POST'];
return (in_array($_SERVER['REQUEST_METHOD'], $allowed));
}
In PHP è semplice filtrare e limitare il tipo di richieste HTTP.
La soluzione è la seguente:
function my_is_valid_http_request_type() {
$allowed = ['GET', 'POST'];
return (in_array($_SERVER['REQUEST_METHOD'], $allowed));
}