123456789101112131415161718192021222324252627282930313233 |
- <?php
- $host = "kurek620.beget.tech";
- $username = "kurek620_baze";
- $password = "6910WASD579h";
- $database = "kurek620_baze";
- $mysql = new mysqli($host, $username, $password, $database);
- if($mysql->connect_error){
- die("Ошибка подключения". $mysql->connect_error);
- }
- $product_id = $_POST["productid"];
- $count_prod = $_POST["countprod"];
- $summ = $_POST["su"];
- $id_login = $_POST["id_login"];
- $query = "INSERT INTO Orders1 (`product_id`, `count_prod`, `summ`, `id_login`)
- VALUES ('$product_id', '$count_prod', '$summ', '$id_login')";
- $result = $mysql->query($query);
- if(!$result){
- echo "Что то не так" . $mysql->error;
- }
- else{
-
- echo "<script>window.location.href = 'product.php';</script>";
- }
- ?>
|