ok
Direktori : /home/keydecors/public_html/admin/controller/ |
Current File : /home/keydecors/public_html/admin/controller/super_stockists.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'],"../super_stockists/".$newfilename1); $img1=$newfilename1; } $sql = "INSERT INTO super_stockists(su_medicine, su_medicine_details, img) VALUES ('$sp_medicine', '$sp_medicine_details', '$img1')"; if (!mysqli_query($mysqli,$sql)) { die('Error: ' . mysqli_error($mysqli)); } header("location:../pages/super_stokist.php?pro=$menu") ?>