123456789101112131415161718192021222324 |
- <?php
- $host = "kurek620.beget.tech";
- $username = "kurek620_baze";
- $password = "6910WASD579h";
- $database = "kurek620_baze";
- $review = $_POST["review"];
- $rating = $_POST["rating"];
- $mysql = new mysqli($host, $username, $password, $database);
- if($mysql->connect_error){
- die("Ошибка подключения". $mysql->connect_error);
- }
- $query = "INSERT INTO reviews (review, rating) VALUES ('$review', '$rating')";
- $result = $mysql->query($query);
- if(!$result){
- echo "Что то не так";
- }
- else{
- echo "<script>window.location.href = 'index.html';</script>";
- }
- ?>
|