File manager - Edit - /home/custbahd/irungikitchen.com/admin1/search/edit/index.php
Back
<?php session_start(); include_once('../../db/connection.php'); if(isset($_POST['edit'])){ $id = $_POST['id']; $name = $_POST['name']; $cat = $_POST['cat']; $sub = $_POST['sub']; $type = $_POST['type']; $gender = $_POST['gender']; $size = $_POST['size']; $genre = $_POST['genre']; $package = $_POST['package']; $original_price = $_POST['original_price']; $price = $_POST['price']; if ($_POST['original_price']=='' OR $_POST['original_price']=='0') { $discount = ''; } else { //Discount = 100 * (Original Price - Discount Price) / Original Price. $discount = round(100 * ($original_price - $price) / $original_price, 2); } $image = $_POST['image']; $sql = "UPDATE shop SET name='$name', cat='$cat', sub='$sub', type='$type', gender='$gender', size='$size', genre='$genre', package='$package', image='$image', original_price='$original_price', price='$price', discount='$discount' WHERE id = '$id'"; //use for MySQLi OOP if($conn->query($sql)){ $_SESSION['success'] = 'Item updated successfully'; } else{ $_SESSION['error'] = 'Something went wrong in updating item'; } } header('location: ../../'); ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 0.7 |
proxy
|
phpinfo
|
Settings