include 'C:\Users\vladi\Downloads\Open Server (Базовый, Расширенный, Максимальный) 5.3.0\OSPanel\domains\kurs\bd.php';
$familia = filter_var(trim($_POST['familia']),
FILTER_SANITIZE_STRING);
$name = filter_var(trim($_POST['name']),
FILTER_SANITIZE_STRING);
$otchestvo = filter_var(trim($_POST['otchestvo']),
FILTER_SANITIZE_STRING);
$City = filter_var(trim($_POST['City']),
FILTER_SANITIZE_STRING);
$Street = filter_var(trim($_POST['Street']),
FILTER_SANITIZE_STRING);
$Numder = filter_var(trim($_POST['Numder']),
FILTER_SANITIZE_STRING);
$seriespassport = filter_var(trim($_POST['seriespassport']),
FILTER_SANITIZE_STRING);
$numberpassport = filter_var(trim($_POST['numberpassport']),
FILTER_SANITIZE_STRING);
$Birthday = filter_var(trim($_POST['Birthday']),
FILTER_SANITIZE_STRING);
$query="INSERT INTO `gragdanin`(`familia`,`name`,`otchestvo`,`City`,`Street`,`Numder`,`seriespassport`,`numberpassport`,`Birthday`) VALUES ('".$familia."','".$name."','".$otchestvo."','".$City."','".$Street."','".$Numder."','".$seriespassport."','".$numberpassport."','".$Birthday."')";
$res =mysqli_query($db, $query);
if ($res==true) {
echo "<script>alert(\"Вы успешно добавили данные!\");</script>";
echo "<script>document.location.href='index.php';</script>";
}
else {
echo "<script>alert(\"Ошибка!Проверьте данные и отправьте снова!\");</script>";
echo "<script>document.location.href='1.php';</script>";
}