Example #1
0
 public function get_data()
 {
     //проверка на нажатие кнопки. валидация на стороне сервера
     if (isset($_POST['GO2'])) {
         $vd = new Model_Validation();
         if ($vd->valid_feed()) {
             $name = $_POST['name'];
             $email = $_POST['email'];
             $text = $_POST['text'];
             $req = "INSERT INTO `feedback`(`name`, `email`, `text`) VALUES ('" . $name . "','" . $email . "','" . $text . "')";
             $db = new connect_disconnect();
             mysqli_query($db->connect(), $req);
             $db = new connect_disconnect();
             header('Location: index.php?feedback');
         }
     }
 }
Example #2
0
 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');
         }
     }
 }