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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Hongkong Lottery Result Today | Live HK Lottery Results (12PM, 5PM, 9:30PM)</title>

    <meta name="description" content="Check Hongkong Lottery Live Results. Get daily Hong Kong lottery results at 12 PM, 5 PM and 9:30 PM with PDF download. Fast and updated results.">
    <meta name="keywords" content="Hongkong lottery result, Hongkong live result, HK lottery today result, Hongkong result today, HK lottery result 2026, lottery result Hongkong">
    <meta name="author" content="Hongkong Lottery Live">
    <meta name="robots" content="index, follow">
    <meta name="language" content="English">

    <meta property="og:title" content="Hongkong Lottery Live Result Today">
    <meta property="og:description" content="Get latest Hongkong Lottery results instantly with download option.">
    <meta property="og:image" content="https://yourdomain.com/finallogo.jpg">
    <meta property="og:url" content="https://yourdomain.com/">
    <meta property="og:type" content="website">
    <link rel="canonical" href="https://yourdomain.com/">
    <link rel="stylesheet" href="css/style.css">
    <link rel="icon" href="finallogo.jpg" type="image/jpg">
</head>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "Hongkong Lottery Live",
  "url": "https://yourdomain.com/",
  "description": "Check daily Hongkong lottery results with live updates and PDF download."
}
</script>

<body>
    <div class="protection-layer"></div>
    <div class="watermark">Hongkong Lottery Live</div>
    <?php
    include("config.php");
    if (isset($_POST["btn"])) {
        //echo 'sdsd';
        $dt = $_POST["searchDate"];
        $qry = mysqli_query($conn, "select * from tbl_result where result_date='" . $dt . "' and status='Done' order by id asc");
        $qry100 = mysqli_query($conn, "select * from tbl_result where result_date='" . $dt . "' and status='Done' order by id DESC");
    } else {
        $dt = date('Y-m-d');
        $qry = mysqli_query($conn, "select * from tbl_result where result_date='" . $dt . "' and status='Done' order by id asc");
        $qry100 = mysqli_query($conn, "select * from tbl_result where result_date='" . $dt . "' and status='Done' order by id DESC");
    }
    $record = mysqli_fetch_array($qry100);
    ?>
    <header class="site-header">
        <img src="finallogo.jpg" class="site-logo" alt="Hong Kong Lottery Logo" style="border: 3px solid white;">
        <div class="site-title">Hongkong Lottery Live</div>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
    </header>
    <div class="container">
        <h2 style="text-align:center;margin-bottom:20px;color: #5525DB;">Hongkong Lottery Result</h2>
        <hr>
        <!-- BUTTONS -->
        <form method="POST">
            <div class="date-search">
                <input type="date" id="searchDate" name="searchDate" style="height:35px;background-color:#9A7EF2;color:#fff;border:1px solid white" value="<?php if (isset($_POST["btn"])) {
                                                                                                                                                                echo $_POST["searchDate"];
                                                                                                                                                            } else {
                                                                                                                                                                echo date('Y-m-d');
                                                                                                                                                            } ?>">
                <button type="submit" name="btn" class="btn btn-success btn-sm" style="background-color: #5525DB;border-radius:10px;border:1px solid white;width:90px">Search</button>
            </div>
        </form>
        <br>
        <h3 style="text-align: center;color:#5525DB;margin-bottom:4px">Today’s Result</h3>
        <div class="date" id="resultDate" style="text-align: center;color:red"><?php echo date('d F, Y', strtotime($dt)); ?></div>
        <?php
        $img1 = '';
        $img2 = '';
        $img3 = '';
        $img11 = '';
        $img22 = '';
        $img33 = '';
        $count1 = mysqli_num_rows($qry);
        if ($count1 > 0) {
            $row1 = mysqli_fetch_array($qry);
            $img1 = $row1["sr_no"] . '.jpg';
            $img11 = $record["sr_no"] . '.jpg';
        }
        if ($count1 > 1) {
            $row1 = mysqli_fetch_array($qry);
            $img2 = $row1["sr_no"] . '.jpg';
            $img22 = $record["sr_no"] . '.jpg';
        }
        if ($count1 == 3) {
            $row1 = mysqli_fetch_array($qry);
            $img3 = $row1["sr_no"] . '.jpg';
            $img33 = $record["sr_no"] . '.jpg';
        }
        ?>
        <div class="time-buttons">
            <button id="btn1" class="btn red">12:00 PM</button>
            <a id="download1" class="btn-note" href="<?php echo ($img1 != '') ? '../hongkong_result/output/' . $img1 : 'javascript:void(0)'; ?>" style="text-decoration: none;color:red;font-size:18px" <?php if ($img1 != '') { ?> download <?php } ?>>Click to download PDF</a>
            <button id="btn2" class="btn red">05:00 PM</button>
            <a id="download2" class="btn-note" href="<?php echo ($img2 != '') ? '../hongkong_result/output/' . $img2 : 'javascript:void(0)'; ?>" style="text-decoration: none;color:red;font-size:18px" <?php if ($img2 != '') { ?> download <?php } ?>>Click to download PDF</a>
            <button id="btn3" class="btn red">09:30 PM</button>
            <a id="download3" class="btn-note" href="<?php echo ($img3 != '') ? '../hongkong_result/output/' . $img3 : 'javascript:void(0)'; ?>" style="text-decoration: none;color:red;font-size:18px" <?php if ($img3 != '') { ?> download <?php } ?>>Click to download PDF</a>
        </div>
        <!-- ADS -->
        <div class="ad-grid">
            <div class="ad-card">
                <!-- <img src="https://picsum.photos/300/200?1"> -->
                <img src="img1.png">
                <p>Discover Hidden Gems</p>
            </div>
            <div class="ad-card">
                <!-- <img src="https://picsum.photos/300/200?2"> -->
                <img src="img2.png">
                <p>Unlock the Impossible</p>
            </div>
            <div class="ad-card">
                <!-- <img src="https://picsum.photos/300/200?3"> -->
                <img src="img3.png">
                <p>Find Your Path</p>
            </div>
            <div class="ad-card">
                <!-- <img src="https://picsum.photos/300/200?4"> -->
                <img src="img4.png">
                <p>Dream Beyond Reality</p>
            </div>
        </div>
        <!-- RESULT BOX -->
        <div class="result-box">
            <h2 style="color: #f5f10c;"><?php echo date('F d, Y'); ?></h2>
            <h3 style="color: #f5d6ca;" id="tm">
                <?php
                //date_default_timezone_set("Asia/Kolkata");
                //echo date('h:i A');
                ?>
            </h3>
            <div class="coming-box">COMING SOON</div>
        </div>
        <div class="result-image-box" id="result-image-box1">
            <img id="resultImage" class="result-img">
        </div>
        <div class="google-center">
            <i class="fa-brands fa-google"></i>
        </div>
    </div>
    <footer class="site-footer">
        <div class="footer-title">Hongkong Lottery Live</div>
        <div class="footer-copy">© 2026 Hongkong Lottery Live. All Rights Reserved.</div>
        <div class="footer-social">
            <a href="#"><i class="fa-brands fa-instagram"></i></a>
            <a href="#"><i class="fa-brands fa-youtube"></i></a>
            <a href="#"><i class="fa-brands fa-facebook"></i></a>
            <a href="#"><i class="fa-brands fa-telegram"></i></a>
            <a href="#"><i class="fa-brands fa-linkedin"></i></a>
            <a href="#"><i class="fa-brands fa-x-twitter"></i></a>
        </div>
    </footer>
    <script>
        //PAGE PROTECT
        navigator.mediaDevices.getDisplayMedia = undefined;
        document.addEventListener("contextmenu", function(e) {
            e.preventDefault();
        });
        // document.onkeydown = function(e) {

        //     if (e.keyCode == 123) { // F12
        //         return false;
        //     }

        //     if (e.ctrlKey && e.shiftKey && e.keyCode == 73) { // Ctrl+Shift+I
        //         return false;
        //     }

        //     if (e.ctrlKey && e.keyCode == 85) { // Ctrl+U
        //         return false;
        //     }

        //     if (e.ctrlKey && e.keyCode == 83) { // Ctrl+S
        //         return false;
        //     }

        // };
        setInterval(function() {
            if (window.outerWidth - window.innerWidth > 160 ||
                window.outerHeight - window.innerHeight > 160) {
                document.body.innerHTML = "Access Denied";
            }
        }, 1000);
        document.addEventListener("dragstart", function(e) {
            e.preventDefault();
        });
        document.addEventListener("visibilitychange", function() {
            if (document.hidden) {
                document.body.style.filter = "blur(20px)";
            } else {
                document.body.style.filter = "blur(0px)";
            }
        });
        const d1 = document.getElementById("download1");
        const d2 = document.getElementById("download2");
        const d3 = document.getElementById("download3");


        setInterval(function() {
            fetch("time.php")
                .then(response => response.text())
                .then(data => {
                    document.getElementById("tm").innerHTML = data;
                });
        }, 1000);
        <?php
        $img = '';
        if ($img11 != '') {
            $img = $img11;
        }
        if ($img22 != '') {
            $img = $img22;
        }
        if ($img33 != '') {
            $img = $img33;
        }
        ?>
        document.getElementById("btn1").addEventListener("click", function() {
            document.getElementById("download1").click();
        });
        document.getElementById("btn2").addEventListener("click", function() {
            document.getElementById("download2").click();
        });

        document.getElementById("btn3").addEventListener("click", function() {
            document.getElementById("download3").click();
        });

        function controlAnimation() {
            const box = document.querySelector(".coming-box");
            const img = document.getElementById("resultImage");
            const imgbox = document.getElementById("result-image-box1");
            const btn1 = document.getElementById("btn1");
            const btn2 = document.getElementById("btn2");
            const btn3 = document.getElementById("btn3");
            const now = new Date();
            const hours24 = now.getHours();
            const minutes = now.getMinutes();
            let hour12 = hours24 % 12;
            hour12 = hour12 ? hour12 : 12;
            let animate = false;
            let button1 = false;
            let button2 = false;
            let button3 = false;
            /* 12:05 – 12:15 */
            if ((hours24 === 12 && minutes >= 5 && minutes <= 15) ||
                (hour12 === 12 && minutes >= 5 && minutes <= 15)) {
                animate = true;
                button1 = true;
            }
            /* 05:05 – 05:15 PM */
            if ((hours24 === 17 && minutes >= 5 && minutes <= 15) ||
                (hour12 === 5 && minutes >= 5 && minutes <= 15)) {
                animate = true;
                button2 = true;
            }
            /* 09:35 – 09:45 PM */
            if ((hours24 === 21 && minutes >= 35 && minutes <= 45) ||
                (hour12 === 9 && minutes >= 35 && minutes <= 45)) {
                animate = true;
                button3 = true;
            }
            if (animate) {
                box.classList.add("animate");
                box.style.display = "inline-block";
                img.style.display = "none";
                imgbox.style.display = "none";
                if (button1 == true) {
                    btn1.classList.add("animate");
                }
                if (button2 == true) {
                    btn2.classList.add("animate");
                }
                if (button3 == true) {
                    btn3.classList.add("animate");
                }

                d1.style.pointerEvents = "none";
                d2.style.pointerEvents = "none";
                d3.style.pointerEvents = "none";

                d1.style.opacity = "0.5";
                d2.style.opacity = "0.5";
                d3.style.opacity = "0.5";

            } else {
                box.classList.remove("animate");
                box.style.display = "inline-block";
                <?php
                if ($img1 == '' and $img2 == '' and $img3 == '') {
                ?>
                    img.style.display = "none";
                    imgbox.style.display = "none";
                <?php
                } else {
                ?>

                    img.style.display = "block";
                    imgbox.style.display = "block";
                <?php
                }
                ?>
                if (button1 == false) {
                    btn1.classList.remove("animate");
                }
                if (button2 == false) {
                    btn2.classList.remove("animate");
                }
                if (button3 == false) {
                    btn3.classList.remove("animate");
                }
                img.src = '<?php echo '../hongkong_result/output/' . $img; ?>';

                d1.style.pointerEvents = "auto";
                d2.style.pointerEvents = "auto";
                d3.style.pointerEvents = "auto";

                d1.style.opacity = "1";
                d2.style.opacity = "1";
                d3.style.opacity = "1";
                //img.style.display = "block";
                //imgbox.style.display = "block";
            }
        }
        controlAnimation();
        setInterval(controlAnimation, 20000);
        controlAnimation();
        setInterval(controlAnimation, 20000);
        controlAnimation();
        /* check every 20 seconds */
        setInterval(controlAnimation, 20000);
    </script>
</body>

</html>