Answer the question
In order to leave comments, you need to log in
Why does $_POST come empty on local server?
In general, I am doing a feedback form and met with such a problem: the $_POST array comes empty on the local server (localhost). If I upload all the site files to the hosting, everything works (namely, the $_POST array is not empty). Why, I don't understand. Here is the php code:
<?php
if (isset($_POST["send"])) {
print_r($_POST);
}
require "header.php";
$active_menu_index = 2;
require 'main_menu.php';
?>
<form name="feedback" action="." method="post">
<label>От кого: </label><br />
<input type="text" name="from" /><br />
<label>Кому: </label><br />
<input type="text" name="to" /><br />
<label>Тема: </label><br />
<input type="text" name="subject" /><br />
<label>Сообщение: </label><br />
<textarea name="message" cols="24" rows="10"></textarea><br />
<input type="submit" name="send" value="Отправить" />
</form>
<?php
require "footer.php";
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Персональный сайт Рамазанова Айтыма</title>
</head>
<body>
<header>
<div class="container">
<ul class="main-menu">
<li class="current">Главная
<li><a href="about_me.php">Обо мне</a>
<li><a href="contact.php">Связаться со мной</a>
</ul>
</div>
</header>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question