UnknownSec Bypass
403
:
/
var
/
www
/
zenithentcare
/
stmedicosoftware
/
prescription
/ [
drwxrwxr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
upload_patimage.php
<?php require_once "../config.php"; session_start(); $docid= $_SESSION['doctorid']; if($_FILES['file']['name']){ $error=array(); $uhid=mysqli_real_escape_string($conn, $_POST['uh_id']); $visitid=mysqli_real_escape_string($conn, $_POST['fileno_id']); $creationdatetime = date("Y-m-d H:m:s"); // $oldimagename=""; // $query = "select pat_imagepath from patdocumenttb where uhid='".$uhid."' // and visitid='".$visitid."'"; // // $result = mysqli_query($conn,$query); // while($row = mysqli_fetch_array($result)) // { // $oldimagename= $row["pat_imagepath"]; // } // if($oldimagename) // { // $removefilename="document_images/".$oldimagename; // unlink($removefilename); // } foreach($_FILES['file']['name'] as $key=>$val){ $patimage_name=$_FILES['file']['name'][$key]; $patimage_size=$_FILES['file']['size'][$key]; $patimage_tmp=$_FILES['file']['tmp_name'][$key]; $patimage_type=$_FILES['file']['type'][$key]; $file_ext=explode('.',$patimage_name); $file_ext=strtolower(end($file_ext)); $extensions=array("jpeg","jpg","png"); if(in_array($file_ext,$extensions)===false){ $error[]="This extension file is not allowed, Please choose a JPG or PNG file."; } if($patimage_size > 2097152) { $error="File size must be 2mb or lower."; } $patimagenew_name=time().$key."-".'img'; $patimagetarget="document_images/".$patimagenew_name; $patimageimage_name=$patimagenew_name; if(empty($errors)==true){ move_uploaded_file($patimage_tmp,$patimagetarget); $query="INSERT into patdocumenttb(uhid,visitid,pat_imagepath,isdeleted,userid,creationdatetime) values('".$uhid."','".$visitid."','".$patimagetarget."',0,'".$docid."','".$creationdatetime."')"; $result=insertrecord($conn,$query); }else{ print_r($error); die(); } } echo json_encode(array('code'=>1, 'path'=>'File Upload Successfully')); // session_start(); // $userid=$_SESSION['adminid']; // // $creationdatetime = date("Y-m-d H:m:s"); // //$date=date("d M, Y"); // // $data=0; // $message=""; // $query = "select count(0) as count from farmerdocumenttb where farmerid='".$farmerid."' and // isdeleted='".$notdeleted."'"; // // $result = mysqli_query($conn,$query); // while($row = mysqli_fetch_array($result)) // { // $message= $row["count"]; // } // // if($message=="0") // { // $sql="INSERT INTO farmerdocumenttb(farmerid,aadhar_imagepath,isdeleted,creationuserid,creationdatetime) // VALUES('{$farmerid}','{$aadharimage_name}','{$notdeleted}','{$userid}','{$creationdatetime}')"; // // if(mysqli_query($conn, $sql)) // { // echo json_encode(array('code'=>1, // 'path'=>$aadharimage_name)); // // // } // // } // else // // { // $sql="Update farmerdocumenttb set aadhar_imagepath='{$aadharimage_name}' where farmerid='".$farmerid."' and // isdeleted='".$notdeleted."'"; // if(mysqli_query($conn, $sql)) { // echo json_encode(array('code'=>1, // 'path'=>$aadharimage_name)); // } // // } } else { echo json_encode(array('code'=>0, 'path'=>'File Upload failed')); } ?>
Copyright © 2025 - UnknownSec