为什么REQUEST_METHOD == POST不能正常使用?在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());
}
?>