public function get_data() { //проверка на нажатие кнопки. валидация на стороне сервера if (isset($_POST['GO'])) { $vd = new Model_Validation(); if ($vd->valid_register()) { $name = $_POST['name']; $surname = $_POST['surname']; $email = $_POST['email']; $sexs = $_POST['sexs']; $birthday = $_POST['birthday']; $req = "INSERT INTO `users`(`name`, `surname`, `email`, `sexs`, `birthday`) VALUES ('" . $name . "','" . $surname . "','" . $email . "','" . $sexs . "','" . $birthday . "')"; $db = new connect_disconnect(); //запись данных в куки пользователя session_start(); mysqli_query($db->connect(), $req); session_start(); $_SESSION['email'] = $email; header('Location: index.php?feedback'); } } }