ok
Direktori : /proc/self/root/home/keydecors/public_html/ca/admin/app/controller/ |
Current File : //proc/self/root/home/keydecors/public_html/ca/admin/app/controller/testimonial_upback.php |
<?php //include database configuration file include("../model/dboperation.php"); $ids = mysqli_real_escape_string($mysqli, $_POST['ids']); $name = mysqli_real_escape_string($mysqli , $_POST['name']); $job = mysqli_real_escape_string($mysqli , $_POST['job']); $testimonial = mysqli_real_escape_string($mysqli , $_POST['testimonial']); 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'],"../testimonial/".$newfilename1); $img=$newfilename1; $sql = "UPDATE testimonial SET name = '$name', job = '$job', testimonial = '$testimonial', img = '$img' WHERE ids='$ids'"; } else { $sql = "UPDATE testimonial SET name = '$name', job = '$job', testimonial = '$testimonial' WHERE ids='$ids'"; } if (!mysqli_query($mysqli,$sql)) { die('Error: ' . mysqli_error($mysqli)); } header("location:../update_testimonial.php?pro=$ids"); ?>