ok
Direktori : /home/keydecors/www/ca/admin/app/controller/ |
Current File : /home/keydecors/www/ca/admin/app/controller/menu_add_back.php |
<?php //include database configuration file include("../model/dboperation.php"); $food_name = mysqli_real_escape_string($mysqli , $_POST['name']); $foodtype = mysqli_real_escape_string($mysqli , $_POST['foodtype']); $price = mysqli_real_escape_string($mysqli , $_POST['price']); $img=''; if(!empty($_FILES["img"]['tmp_name'])){ $temp1 = explode(".",$_FILES["img"]["name"]); $newfilename1 = rand(). "_".date('m-d-Y_hia') . '.' .end($temp1); move_uploaded_file($_FILES['img']['tmp_name'],"../images/".$newfilename1); $img=$newfilename1; } $sql = "INSERT INTO menu_details(food_typs, food_name, price, food_image) VALUES ('$foodtype', '$food_name', '$price', '$img')"; if (!mysqli_query($mysqli,$sql)) { die('Error: ' . mysqli_error($mysqli)); } header("location:../menu.php"); ?>