server value but it returns always nulll
<?php
$result_api = array();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = $_POST['server'];
if (empty($name)) {
$result_api['status']="Name is empty";
} else {
$result_api['status'] = $name;
}
}
header('Content-type: application/json');
echo json_encode($result_api);
?>
Could someone tell me the error here?
PHP group
Обсуждают сегодня