ok
Direktori : /home/keydecors/www/admin/controller/ |
Current File : /home/keydecors/www/admin/controller/specialty.php |
<?php //include database configuration file include("../model/dboperation.php"); $sp_medicine = mysqli_real_escape_string($mysqli , $_POST['sp_medicine']); $sp_medicine_details = mysqli_real_escape_string($mysqli , $_POST['sp_medicine_details']); $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'],"../speciality/".$newfilename1); $img1=$newfilename1; } $sql = "INSERT INTO sp_medicine(sp_medicine, sp_medicine_details, img) VALUES ('$sp_medicine', '$sp_medicine_details', '$img1')"; if (!mysqli_query($mysqli,$sql)) { die('Error: ' . mysqli_error($mysqli)); } ob_clean(); header("location:../pages/specialty_medicines.php"); echo "<script type='text/javascript'> document.location = '../pages/specialty_medicines.php'; </script>"; ?>