Why is REQUEST_METHOD == POST not ok to use? What would be a better way to write this code in PHP 7.0.0.?
<?php
$connection= mysqli_connect("localhost","root","root","root");
if(!empty($_POST) && $_SERVER['REQUEST_METHOD'] == 'POST'){
// Kontrola připojení
if($connection === false){
die("ERROR: Error conecting to database. " . mysqli_connect_error());
}
?>