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