Uname : Linux V-ShopU01 4.18.0-348.20.1.el8_5.x86_64 #1 SMP Thu Mar 10 20:59:28 UTC 2022 x86_64
Server : Apache/2.4.37 (rocky) OpenSSL/1.1.1k
Whoami : apache
Safe Mode : OFF
DOCUMENT ROOT : /var/www/html/site_shopudiet
Disable Function :
Path : /var/www/html/site_shopudiet/admin/

Server IP : 65.20.74.164 Client IP : 18.218.93.169
Current File : /var/www/html/site_shopudiet/admin/add_fishes.php
    <?php
    include 'dbconnect.php';

    $cat ='fishes';
    $product_code=$_POST['product_code'];
     
      $p_name=$_POST['product_name'];
      $price=$_POST['price'];
$status='yes';
      
      
      
       $weight=$_POST['weight'];

      $desc=$_POST['description'];
      
       
      $file_name1 = basename($_FILES["file1"]["name"]);
      $target_file =  "img/".basename($_FILES["file1"]["name"]);
      move_uploaded_file($_FILES["file1"]["tmp_name"], $target_file);




      $file_name2 = basename($_FILES["file2"]["name"]);
      $target_file =  "img/".basename($_FILES["file2"]["name"]);
      move_uploaded_file($_FILES["file2"]["tmp_name"], $target_file);

      $file_name3 = basename($_FILES["file3"]["name"]);
      $target_file =  "img/".basename($_FILES["file3"]["name"]);
      move_uploaded_file($_FILES["file3"]["tmp_name"], $target_file);

      



       $sql="INSERT INTO fish(name,price,weight,description,file1,file2,file3,status) VALUES('$p_name','$price','$weight','$desc','$file_name1','$file_name2','$file_name3','$status')";


       if ($conn->query($sql) === TRUE)
         {
              echo "<script> alert('Successfull'); window.location.href='view_fish.php'; </script>";

        } 
      else 
         {
           echo "Error: " . $sql . "<br>" . $conn->error;
         }


    ?>