review.php 630 B

12345678910111213141516171819202122232425
  1. <?php
  2. $host = "blueris.beget.tech";
  3. $username = "blueris_base";
  4. $password = "Qwer123.";
  5. $database = "blueris_base";
  6. $mysql = new mysqli($host, $username, $password, $database);
  7. if($mysql->connect_error){
  8. die("Ошибка подключения". $mysql->connect_error);
  9. }
  10. $review = $_POST["review"];
  11. $name = $_POST["name"];
  12. $rating = $_POST["rating"];
  13. $query = "INSERT INTO review (name, review, rating) VALUES ('$name', '$review', '$rating')";
  14. $result = $mysql->query($query);
  15. if(!$result){
  16. echo "Что то не так" . $mysql->error;
  17. }
  18. else
  19. {
  20. echo "<script>window.location.href = 'index.php';</script>";
  21. }
  22. ?>