Thứ Sáu, 20 tháng 11, 2026

Thanh Toán Zalopay trên web

 Link down ứng dụng trên máy điện thoại để test Zalopay Sanbox:
 https://docs.zalopay.vn/docs/developer-tools/test-instructions/test-wallets#deposit

- Dùng Chrome trên máy down app và cài trên điện thoại:



**** Dùng để test giá tiền trên app thanh toán Zalopay Sanbox
Link Down:
- Download 1
- Download2

Slide Mới - New Slide

 

<!DOCTYPE html>

<html lang="vi">

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Slide full - chữ chạy theo từng hình</title>

<link rel="preconnect" href="https://fonts.googleapis.com">

<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

<link href="https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;800&display=swap" rel="stylesheet">

<style>

    .hero {

        --dur: 6s;  /* thời gian mỗi slide */

        --accent: #f5a623;

        position: relative;

        width: 100%;

        height: clamp(420px, 64vh, 660px);

        overflow: hidden;

        background: #0d2a52;

        color: #fff;

        outline: none;

    }

    /* ----- Từng slide ----- */

    .slide {

        position: absolute;

        inset: 0;

        opacity: 0;

        visibility: hidden;

        transition: opacity .9s ease, visibility 0s linear .9s;

    }

    .slide.is-active {

        opacity: 1;

        visibility: visible;

        transition: opacity .9s ease, visibility 0s;

    }

    /* Hình nền (có gradient dự phòng nếu ảnh lỗi) + hiệu ứng zoom nhẹ */

    .slide::before {

        content: "";

        position: absolute;

        inset: 0;

        background:

            var(--bg, none) center / cover no-repeat,

            linear-gradient(120deg, var(--c1, #0d2a52), var(--c2, #1565c0));

        transform: scale(1.08);

    }

    .slide.is-active::before { animation: zoomOut 9s ease-out forwards; }

    @keyframes zoomOut { to { transform: scale(1); } }


    /* Lớp tối để chữ dễ đọc */

    .slide::after {

        content: "";

        position: absolute;

        inset: 0;

        background: linear-gradient(90deg, rgba(6,20,45,.80) 0%, rgba(6,20,45,.40) 55%, rgba(6,20,45,0) 100%);

    }

    /* ----- Nội dung chữ ----- */

    .slide-inner {

        position: relative;

        z-index: 2;

        height: 100%;

        max-width: 840px;

        box-sizing: border-box;

        padding: 0 max(24px, 8vw);

        display: flex;

        flex-direction: column;

        justify-content: center;

        align-items: flex-start;

    }

    /* Tiêu đề: từng chữ trượt lên */

    .s-title {

        margin: 0 0 18px;

        font-size: clamp(30px, 5vw, 64px);

        line-height: 1.12;

        font-weight: 800;

        letter-spacing: -.01em;

    }

    .s-title .w {

        display: inline-block;

        overflow: hidden;

        vertical-align: top;

        padding: .12em 0 .16em;           /* chừa chỗ cho dấu tiếng Việt */

        margin: -.12em 0 -.16em;

    }

    .s-title .w > span {

        display: inline-block;

        transform: translateY(120%);

        transition: transform .8s cubic-bezier(.2, .8, .2, 1) 0s;

    }

    .slide.is-active .s-title .w > span {

        transform: none;

        transition-delay: var(--d, .25s);

    }

    /* Mô tả: gõ từng chữ */

    .s-desc {

        margin: 0 0 28px;

        max-width: 560px;

        min-height: 3.4em;               /* giữ chỗ, tránh nhảy layout khi đang gõ */

        font-size: clamp(15px, 1.5vw, 18px);

        line-height: 1.7;

        color: rgba(255,255,255,.92);

        opacity: 0;

        transition: opacity .4s ease;

    }

    .slide.is-active .s-desc { opacity: 1; transition-delay: .5s; }

    .s-desc.typing::after {

        content: "";

        display: inline-block;

        width: 2px;

        height: 1.05em;

        margin-left: 3px;

        vertical-align: text-bottom;

        background: var(--accent);

        animation: caret .7s steps(1) infinite;

    }

    @keyframes caret { 50% { opacity: 0; } }

    /* Nút */

    .s-btn {

        display: inline-block;

        padding: 13px 28px;

        border-radius: 999px;

        background: var(--accent);

        color: #1b2a41;

        font-weight: 700;

        font-size: 15px;

        text-decoration: none;

        opacity: 0;

        transform: translateY(14px);

        transition: opacity .6s ease, transform .6s ease, filter .2s ease;

    }

    .slide.is-active .s-btn { opacity: 1; transform: none; transition-delay: .95s, .95s, 0s; }

    .s-btn:hover { filter: brightness(1.08); }

    /* ----- Mũi tên ----- */

    .hero-arrow {

        position: absolute;

        top: 50%;

        z-index: 5;

        width: 48px;

        height: 48px;

        margin-top: -24px;

        border: 1px solid rgba(255,255,255,.35);

        border-radius: 50%;

        background: rgba(255,255,255,.12);

        -webkit-backdrop-filter: blur(6px);

        backdrop-filter: blur(6px);

        color: #fff;

        font-size: 22px;

        line-height: 1;

        cursor: pointer;

        /* Ẩn mặc định, rê chuột vào slide mới hiện */

        opacity: 0;

        pointer-events: none;

        transition: opacity .3s ease, transform .3s ease, background .2s ease;

    }

    .hero-prev { left: 20px;  transform: translateX(-14px); }

    .hero-next { right: 20px; transform: translateX(14px); }

    .hero:hover .hero-arrow,

    .hero:focus-within .hero-arrow {

        opacity: 1;

        pointer-events: auto;

        transform: none;

    }

    .hero-arrow:hover { background: rgba(255,255,255,.28); }

    /* ----- Chấm điều hướng ----- */

    .hero-dots {

        position: absolute;

        left: max(24px, 8vw);

        bottom: 28px;

        z-index: 5;

        display: flex;

        gap: 10px;

    }

    .hero-dots button {

        width: 28px;

        height: 4px;

        padding: 0;

        border: 0;

        border-radius: 4px;

        background: rgba(255,255,255,.4);

        cursor: pointer;

        transition: width .3s ease, background .3s ease;

    }

    .hero-dots button.is-active { width: 48px; background: #fff; }


    /* ----- Thanh tiến trình (hết thanh thì sang slide kế) ----- */

    .hero-progress {

        position: absolute;

        left: 0; right: 0; bottom: 0;

        height: 4px;

        z-index: 5;

        background: rgba(255,255,255,.15);

    }

    .hero-progress i {

        display: block;

        height: 100%;

        width: 100%;

        background: var(--accent);

        transform-origin: left center;

        transform: scaleX(0);

        animation: fill var(--dur) linear forwards;

    }

    @keyframes fill { to { transform: scaleX(1); } }

    .hero.is-paused .hero-progress i { animation-play-state: paused; }

    /* ----- Mobile ----- */

    @media (max-width: 700px) {

        .hero-arrow { display: none; }

        .slide::after { background: linear-gradient(180deg, rgba(6,20,45,.35) 0%, rgba(6,20,45,.85) 100%); }

        .slide-inner { justify-content: flex-end; padding-bottom: 76px; }

        .hero-dots { bottom: 24px; }

    }

    /* ----- Người dùng tắt hiệu ứng chuyển động ----- */

    @media (prefers-reduced-motion: reduce) {

        .slide.is-active::before { animation: none; transform: none; }

        .s-title .w > span, .s-btn { transform: none; transition: none; }

        .s-btn, .s-desc { opacity: 1; }

        .hero-progress { display: none; }

    }

</style>

</head>

<body>

<!-- =========================================================

     SLIDE FULL - HTML

     Mỗi <article class="slide"> là một hình.

     --bg: đường dẫn ảnh nền | --c1, --c2: màu dự phòng khi chưa có ảnh

     ========================================================= -->

<section class="hero" id="hero" tabindex="0" aria-roledescription="carousel" aria-label="Banner nổi bật">

    <article class="slide is-active" style="--bg:url('/uploads/slide/slide1.jpg'); --c1:#0d2a52; --c2:#1976d2;">

        <div class="slide-inner">

            <h2 class="s-title">Móc treo áo vest cao cấp</h2>

            <p class="s-desc">Form vai chuẩn, giữ dáng áo bền đẹp. Phù hợp cửa hàng thời trang và xưởng may.</p>

            <a class="s-btn" href="/san-pham/moc-treo-ao-vest-j1">Xem sản phẩm</a>

        </div>

    </article>

    <article class="slide" style="--bg:url('/uploads/slide/slide2.jpg'); --c1:#4a2b12; --c2:#b8742e;">

        <div class="slide-inner">

            <h2 class="s-title">Móc gỗ sang trọng cho tủ quần áo</h2>

            <p class="s-desc">Gỗ tự nhiên, hoàn thiện mịn, nâng tầm không gian trưng bày của bạn.</p>

            <a class="s-btn" href="/san-pham/moc-go-treo-quan-ao-js2">Khám phá ngay</a>

        </div>

    </article>

    <article class="slide" style="--bg:url('/uploads/slide/slide3.jpg'); --c1:#10301f; --c2:#2e8b57;">

        <div class="slide-inner">

            <h2 class="s-title">Giảm 50% cho dòng J1 và J4</h2>

            <p class="s-desc">Số lượng có hạn. Đặt số lượng lớn để nhận báo giá tốt nhất cho cửa hàng.</p>

            <a class="s-btn" href="#">Liên hệ báo giá</a>

        </div>

    </article>

    <article class="slide" style="--bg:url('/uploads/slide/slide4.jpg'); --c1:#2b1850; --c2:#6a3fc4;">

        <div class="slide-inner">

            <h2 class="s-title">Giao hàng toàn quốc, đổi trả dễ dàng</h2>

            <p class="s-desc">Tư vấn miễn phí theo nhu cầu, giao nhanh trong 2 đến 4 ngày làm việc.</p>

            <a class="s-btn" href="#">Nhận tư vấn</a>

        </div>

    </article>

    <button class="hero-arrow hero-prev" type="button" aria-label="Slide trước">&#8249;</button>

    <button class="hero-arrow hero-next" type="button" aria-label="Slide kế tiếp">&#8250;</button>

    <div class="hero-dots" role="tablist" aria-label="Chọn slide"></div>

    <div class="hero-progress" aria-hidden="true"><i></i></div>

</section>

<!-- 👉

     SLIDE FULL - JavaScript (thuần, không cần jQuery)
-->

<script>

(function () {

    var hero = document.getElementById('hero');

    if (!hero) return;

    var slides  = [].slice.call(hero.querySelectorAll('.slide'));

    var dotsBox = hero.querySelector('.hero-dots');

    var bar     = hero.querySelector('.hero-progress i');

    var cur = 0, typeTimer = null, typeDelay = null;

    var reduce = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;

    var dots = [];

    // 1) Tách tiêu đề thành từng chữ để chạy lần lượt

    slides.forEach(function (s) {

        var t = s.querySelector('.s-title');

        var text = t.textContent.replace(/\s+/g, ' ').trim();

        t.setAttribute('aria-label', text);

        t.innerHTML = '';

        text.split(' ').forEach(function (word, i) {

            var w = document.createElement('span');

            w.className = 'w';

            w.setAttribute('aria-hidden', 'true');

            var inner = document.createElement('span');

            inner.textContent = word;

            inner.style.setProperty('--d', (0.25 + i * 0.09) + 's');

            w.appendChild(inner);

            t.appendChild(w);

            t.appendChild(document.createTextNode(' '));

        });

        var d = s.querySelector('.s-desc');

        d.setAttribute('data-full', d.textContent.replace(/\s+/g, ' ').trim());

    });

    // 2) Tạo chấm điều hướng

    slides.forEach(function (s, i) {

        var b = document.createElement('button');

        b.type = 'button';

        b.setAttribute('aria-label', 'Slide ' + (i + 1));

        b.addEventListener('click', function () { goTo(i); });

        dotsBox.appendChild(b);

        dots.push(b);

    });

    // 3) Hiệu ứng gõ chữ cho mô tả

    function typeText(el, text) {

        clearInterval(typeTimer);

        clearTimeout(typeDelay);

        if (reduce) { el.textContent = text; return; }

        el.textContent = '';

        el.classList.add('typing');

        typeDelay = setTimeout(function () {

            var i = 0;

            typeTimer = setInterval(function () {

                i++;

                el.textContent = text.slice(0, i);

                if (i >= text.length) {

                    clearInterval(typeTimer);

                    el.classList.remove('typing');

                }

            }, 22);

        }, 700);

    }

    // 4) Chuyển slide

    function goTo(n) {

        n = (n + slides.length) % slides.length;

        slides[cur].classList.remove('is-active');

        dots[cur].classList.remove('is-active');

        cur = n;

        slides[cur].classList.add('is-active');

        dots[cur].classList.add('is-active');

        dots[cur].setAttribute('aria-current', 'true');

        // chạy lại thanh tiến trình

        bar.style.animation = 'none';

        void bar.offsetWidth;

        bar.style.animation = '';

        var d = slides[cur].querySelector('.s-desc');

        typeText(d, d.getAttribute('data-full'));

    }

    function next() { goTo(cur + 1); }

    function prev() { goTo(cur - 1); }

    // Thanh tiến trình chạy hết thì tự sang slide kế

    bar.addEventListener('animationend', function () { if (!reduce) next(); });

    hero.querySelector('.hero-next').addEventListener('click', next);

    hero.querySelector('.hero-prev').addEventListener('click', prev);

    // 5) Tạm dừng khi rê chuột / focus / chuyển tab

    function pause()  { hero.classList.add('is-paused'); }

    function resume() { hero.classList.remove('is-paused'); }

    hero.addEventListener('mouseenter', pause);

    hero.addEventListener('mouseleave', resume);

    hero.addEventListener('focusin', pause);

    hero.addEventListener('focusout', resume);

    document.addEventListener('visibilitychange', function () {

        document.hidden ? pause() : resume();

    });

    // 6) Phím mũi tên + vuốt trên điện thoại

    hero.addEventListener('keydown', function (e) {

        if (e.key === 'ArrowRight') next();

        if (e.key === 'ArrowLeft')  prev();

    });

    var x0 = null;

    hero.addEventListener('touchstart', function (e) { x0 = e.touches[0].clientX; }, { passive: true });

    hero.addEventListener('touchend', function (e) {

        if (x0 === null) return;

        var dx = e.changedTouches[0].clientX - x0;

        if (Math.abs(dx) > 50) { dx < 0 ? next() : prev(); }

        x0 = null;

    });

    // Khởi động

    slides[0].classList.remove('is-active');

    goTo(0);

})();

</script>

</body>

</html>


Thứ Năm, 19 tháng 11, 2026

HACK IN COOKIE PHP

 

***** Code:

hack_report("Hack in COOKIE - ".$var_name." = ".$var_value);

👉 nằm trong file ROOT/includes/functions/security.php line 175

Thay CODE bằng:

if($security_cookies==1) {    

    foreach ($_COOKIE as $var_name => $var_value) {

        // Bỏ qua kiểm tra đối với các cookie c_ref từ trình duyệt/máy tìm kiếm

        if (strpos($var_name, 'c_ref') === 0) {

            continue;

        }

        if (preg_match("/<.*?(script|object|iframe|applet|meta|style|form|img|onmouseover|body).*?>/", $var_value)) die ($htmlerr);

        if (preg_match("/^(http\:\/\/|ftp\:\/\/|\/\/|https:\/\/|php:\/\/|\/\/)/i", $var_value)) die ("Hack in COOKIE 1111 - ".$var_name." = ". $var_value);

        $security_string = "/UNION|OUTFILE|SELECT|ALTER|INSERT|DROP|FROM|WHERE|UPDATE|".$prefix."_authors|".$prefix."_users|UpdateAuthor|AddAuthor|mod_authors|modifyadmin|deladmin|deladmin2/i";

        $security_decode = base64_decode($var_value);

        if (preg_match($security_string, $security_decode)) die ("Hack base64 in COOKIE - ".$var_name." = ". $var_value."");

        if (preg_match($security_string, $var_value)) die ("Hack in COOKIE 2222 - ".$var_name." = ". $var_value."");

        $security_slash = preg_replace("/\/\*.*?\*\//", "", $var_value);

        if (preg_match($security_string, $security_slash)) die ("Hack in COOKIE 3333 - ".$var_name." = ". $var_value."");

    }

}

Thứ Hai, 16 tháng 11, 2026

Copy Text Css AND No Copy Text

Chỉ có trang Liên Hệ là cho copy text && tất cả không cho copy

**** HTML

$bodyClass = (strpos($_SERVER['REQUEST_URI'], 'lien-he') !== false) ? 'cho-phep-copy' : '';


<body class="'.$bodyClass.'">

**** CSS

body {

    font-family: "Roboto Condensed", sans-serif !important;

    margin: 0;

    padding: 0;

    background: #fff;

    font-size: 12px;

    /* khóa copy toàn trang */

    -webkit-user-select: none;

    -ms-user-select: none;

    user-select: none;

}

/* BẮT BUỘC: ô nhập liệu phải gõ/chọn được (đặc biệt trên iPhone/Safari) */

input, textarea, select, [contenteditable="true"] {

    -webkit-user-select: text;

    -ms-user-select: text;

    user-select: text;

}

/* Riêng phần Liên hệ được copy */

.cho-phep-copy,

.cho-phep-copy * {

    -webkit-user-select: text !important;

    -ms-user-select: text !important;

    user-select: text !important;

}    


Thứ Ba, 10 tháng 11, 2026

AJAX UPDATE PRICE SALEOFFPRICE TWO FEILD

 

**** HTML

<input type="text" class="form-control" name="admin_price" value="30000" data-pid="149">

<input type="text" class="form-control" name="admin_saleoffprice" value="10000" data-pid="149" style="border-color: rgb(217, 83, 79);">

**** JS

$(document).on('keyup', 'input[name="admin_price"], input[name="admin_saleoffprice"]', function () {    

    const $input = $(this);

    const pid    = $input.data('pid');

    const field  = $input.attr('name') === 'admin_price' ? 'price' : 'saleoff_price';

    const value  = $input.val().replace(/[^\d]/g, ''); // chỉ giữ số

    clearTimeout($input.data('timer')); // timer riêng cho từng ô

    $input.data('timer', setTimeout(function () {

        $.ajax({

            url: '/modules.php',

            type: 'POST',

            dataType: 'html',

            data: { name: 'Shoping', op: 'ajax_gia_sp', pid: pid, field: field, value: value },

            beforeSend: function () {

                $input.css('border-color', '#f0ad4e'); // đang lưu

            },

            success: function (res) {

                console.log(res);

                $input.css('border-color', $.trim(res) == 1 ? '#5cb85c' : '#d9534f');

            },

            error: function (xhr, status, err) {

                console.log(xhr.status, err);

                console.log(xhr.responseText);

                $input.css('border-color', '#d9534f');

            }

        });

    }, 500));

});

/*** FUNCTION ***/

function ajax_gia_sp(){

    ini_set('display_errors', 1);

    error_reporting(E_ALL);

    global $db, $data_cua_ban;

    // Danh sách cột được phép sửa (map từ field gửi lên -> tên cột thật)

    $allow = array(

        'price'         => 'price',

        'saleoff_price' => 'saleoff_price'

    );

    $pid   = isset($_POST['pid'])   ? (int)$_POST['pid'] : 0;

    $field = isset($_POST['field']) ? $_POST['field'] : '';

    $value = isset($_POST['value']) ? (int)preg_replace('/[^\d]/', '', $_POST['value']) : 0;

    if ($pid <= 0 || !isset($allow[$field])) {

        echo 0;

        exit;

    }

    $col = $allow[$field];

    $sql = "UPDATE `".$data_cua_ban."_shop` SET `".$col."` = '".$value."' WHERE `pid` = '".$pid."'";

    echo "POST: "; print_r($_POST); echo "\n";

    echo "SQL: ".$sql."\n";

    $result = $db->sql_query($sql);

    echo "Result: "; var_dump($result); echo "\n";

    if (method_exists($db, 'sql_error')) { print_r($db->sql_error()); }

    if (method_exists($db, 'sql_affectedrows')) { echo "Affected rows: ".$db->sql_affectedrows()."\n"; }

    exit;

}

/*** TỪ 3 CỘT (FEILD) TRƠ LÊN ***/

<input type="text" class="form-control ajax-money" name="admin_price"  data-field="price"  value="0" data-pid="149">

<input type="text" class="form-control ajax-money" name="admin_saleoffprice" data-field="saleoff_price" value="0" data-pid="149">

<input type="text" class="form-control ajax-money" name="admin_sale" data-field="sale_price" value="0" data-pid="149">

$(document).on('keyup', '.ajax-money', function () {

    const $input = $(this);

    const pid    = $input.data('pid');

    const field  = $input.data('field');

    const value  = $input.val().replace(/[^\d]/g, ''); // chỉ giữ số

    clearTimeout($input.data('timer')); // timer riêng từng ô

    $input.data('timer', setTimeout(function () {

        $.ajax({

            url: '/modules.php',

            type: 'POST',

            dataType: 'html',

            data: { name: 'Shoping', op: 'ajax_gia_sp', pid: pid, field: field, value: value },

            beforeSend: function () {

                $input.css('border-color', '#f0ad4e');

            }

        })

        .done(function (res) {

            console.log(res);

            $input.css('border-color', $.trim(res) == 1 ? '#5cb85c' : '#d9534f');

        })

        .fail(function (xhr, status, err) {

            console.log(xhr.status, err);

            console.log(xhr.responseText);

            $input.css('border-color', '#d9534f');

        });

    }, 500));

});

function ajax_update_price(){

    global $db, $data_cua_ban;

    // field gửi lên => tên cột thật trong bảng

    $allow = array(

        'price'        => 'price',

        'saleoffprice' => 'saleoff_price',

        'sale'        => 'sale_price',       

    );

    $pid   = isset($_POST['pid'])   ? (int)$_POST['pid'] : 0;

    $field = isset($_POST['field']) ? $_POST['field'] : '';

    $value = isset($_POST['value']) ? (int)preg_replace('/[^\d]/', '', $_POST['value']) : 0;

    if ($pid <= 0 || !isset($allow[$field])) {

        echo 0;

        exit;

    }

    $col    = $allow[$field];

    $result = $db->sql_query("UPDATE `".$data_cua_ban."_shop` SET `".$col."` = '".$value."' WHERE `pid` = '".$pid."'");

    echo $result ? 1 : 0;

    exit;

}

Chủ Nhật, 1 tháng 11, 2026

Debug Ghi Lỗi trong File

Cách 1: có file php-error.log sẵn trên server


 if (!function_exists('vb_debug')) {

    function vb_debug($msg){

        // Đường dẫn tới public_html/php-error.log

        $file = $_SERVER['DOCUMENT_ROOT'].'/php-error.log';

        @error_log(date('Y-m-d H:i:s').' '.$msg."\n", 3, $file);

    }

}

$today   = date('Y-m-d');

$tag       = 'SPMODE userid='.$userid.' level='.$userlevel.' today='.$today.' => ';

vb_debug($tag.'ROW begin='.$begin.' end='.$end);

Cách 1: chưa có file php-error.log trên server

if (!function_exists('vb_debug')) {

    function vb_debug($msg){

        $root = !empty($_SERVER['DOCUMENT_ROOT']) ? rtrim($_SERVER['DOCUMENT_ROOT'], '/\\') : dirname(__FILE__);

        $file = $root . '/php-error.log';

        // Chưa có file thì tạo

        if (!file_exists($file)) {

            if (@file_put_contents($file, '') === false) {

                return false;   // không tạo được: thư mục không có quyền ghi

            }

            @chmod($file, 0644);

        }

        if (!is_writable($file)) return false;

        return @error_log(date('Y-m-d H:i:s') . ' ' . $msg . "\n", 3, $file);

    }

}

===> Ghi lỗi

$tag   = 'SPMODE userid='.$userid.' level='.$userlevel.' today='.$today.' => ';

vb_debug($tag.'STOP: SQL error');

## Ghi Nhận Code và chức năng của hàm ##

Số 3 là kiểu ghi của hàm error_log():
Số  Ý nghĩa:
0   Ghi vào log mặc định của PHP
1   Gửi qua email
3   Ghi nối tiếp (append) vào file chỉ định ở tham số thứ 3
4   Gửi thẳng vào SAPI logger