Здравствуйте! Помогите пожалуйста разобраться, почему не работает код...
$servername = "localhost";
$username = "root";
$password = "";
$db_name = "otzivi";
$conn = mysqli_connect($servername, $username, $password, $db_name);
if (!$conn)
die("Non connection: " . mysqli_connect_error());
if(isset($_POST['add'])){
$name = strip_tags(trim($_POST['form_name']));
$text = strip_tags(trim($_POST['form_text']));
$date = $_POST['date'];
$time = $_POST['time'];
$query = "INSERT INTO myotziv(title, date, time, text) VALUES ('$name', '$date', '$time', $text')";
mysqli_query($conn, $query);
}
<form action="" method="post" class="dobaviti_otziv">
Имя: <br><input type="text" name="form_name" class="form_name" /><br>
Отзыв: <br><textarea name="form_text" id="" cols="30" rows="10"></textarea><br>
<input type="hidden" name="date" value="<?php echo date('Y-m-d'); ?>" />
<input type="hidden" name="time" value="<?php echo date('H:i:s'); ?>" />
<input type="submit" name="add" value="Добавить" />
</form>