File manager - Edit - /home/custbahd/irungikitchen.com/admin/add/index.php
Back
<?php session_start(); include_once('../db/connection.php'); if(isset($_POST['submit'])){ $name = $_POST['name']; $cat = $_POST['cat']; $label_1 = $_POST['label_1']; $price_1 = $_POST['price_1']; $label_2 = $_POST['label_2']; $price_2 = $_POST['price_2']; $label_3 = $_POST['label_3']; $price_3 = $_POST['price_3']; $p_range1 = $_POST['p_range1']; $p_range2 = $_POST['p_range2']; $instock = $_POST['instock']; $image = $_FILES['image']['name']; $target = "../images/".basename($_FILES['image']['name']); $sql = "INSERT INTO shop (name, cat, image, label_1, price_1, label_2, price_2, label_3, price_3, p_range1, p_range2, instock) VALUES ('$name','$cat','$image','$label_1','$price_1','$label_2','$price_2','$label_3','$price_3','$p_range1','$p_range2','$instock')"; if (move_uploaded_file($_FILES['image']['tmp_name'], $target)); //use for MySQLi OOP if($conn->query($sql)){ $_SESSION['success'] = 'Item added successfully'; } else{ $_SESSION['error'] = 'Something went wrong while adding'; } } header('location: ../'); ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 2.6 |
proxy
|
phpinfo
|
Settings