UnknownSec Bypass
403
:
/
var
/
www
/
jpsagrisolution
/
cpanel
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
save_product.php
<?php include "../panelassets/config.php"; if($_FILES['fileToUpload']['name']){ $error=array(); $file_name=$_FILES['fileToUpload']['name']; $file_size=$_FILES['fileToUpload']['size']; $file_tmp=$_FILES['fileToUpload']['tmp_name']; $file_type=$_FILES['fileToUpload']['type']; $file_ext=explode('.',$file_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($file_size > 2097152) { $error="File size must be 2mb or lower."; } $new_name=time()."-".basename($file_name); $target="product_images/".$new_name; $image_name=$new_name; if(empty($errors)==true){ move_uploaded_file($file_tmp,$target); }else{ print_r($error); die(); } } session_start(); $userid=$_SESSION['adminid']; $productname=mysqli_real_escape_string($conn, $_POST['productname']); $price=mysqli_real_escape_string($conn, $_POST['price']); $description=mysqli_real_escape_string($conn, $_POST['long_description']); $long_desc=mysqli_real_escape_string($conn, $_POST['long_desc']); $creationdatetime = date("Y-m-d H:m:s"); //$date=date("d M, Y"); $data="0"; $cnt=""; $query = "select count(0) as count from producttb where productname='".$productname."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $cnt= $row["count"]; } if($cnt=="0") { $sql="INSERT INTO producttb(productname,price,long_desc,description,image_name,isdeleted,creationuserid,creationdatetime) VALUES('{$productname}','{$price}','{$long_desc}','{$description}','{$image_name}','{$notdeleted}','{$userid}','{$creationdatetime}')"; if(mysqli_query($conn, $sql)) { $data=1; } }else { $data=2; } echo json_encode($data); ?>
Copyright © 2025 - UnknownSec