ok
Direktori : /home/keydecors/www/admin/controller/ |
Current File : /home/keydecors/www/admin/controller/p_add_back.php |
<?php //include database configuration file include("../model/dboperation.php"); $title = mysqli_real_escape_string($mysqli , $_POST['title']); 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'],"../pro/".$newfilename1); $img=$newfilename1; } $sql = "INSERT INTO gallery(title, img) VALUES ('$title', '$img')"; if (!mysqli_query($mysqli,$sql)) { die('Error: ' . mysqli_error($mysqli)); } echo "<script>window.location.href='http://keydecors.com/admin/pages/pro_select.php';</script>"; ob_clean(); ?>