ok
Direktori : /home/keydecors/www/admin/controller/ |
Current File : /home/keydecors/www/admin/controller/slider_add_back.php |
<?php //include database configuration file include("../model/dboperation.php"); $p_name = mysqli_real_escape_string($mysqli , $_POST['p_name']); /*?>$p_price = mysqli_real_escape_string($mysqli , $_POST['p_price']);<?php */ $p_information = mysqli_real_escape_string($mysqli , $_POST['p_information']); $img1=''; if(!empty($_FILES["img1"]['tmp_name'])){ $temp1 = explode(".",$_FILES["img1"]["name"]); $newfilename1 = rand(). "_".date('m-d-Y_hia') . '.' .end($temp1); move_uploaded_file($_FILES['img1']['tmp_name'],"../slider/".$newfilename1); $img1=$newfilename1; } $sql = "INSERT INTO sliders(title, details, img) VALUES ('$p_name', '$p_information', '$img1')"; if (!mysqli_query($mysqli,$sql)) { die('Error: ' . mysqli_error($mysqli)); } header("location:../pages/slider_add.php?pro=$menu") ?>