<?php
require 'db_connect.php';

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $code = $_POST['qr_code'];

    // You should have a table 'verified_codes' or check 'products' table
    // For now, let's assume specific logic:
    
    // 1. If QR contains a specific URL from your site
    if (strpos($code, 'flowtechbd.com') !== false) {
        echo "authentic";
    } 
    // 2. Or check against a database of serial numbers
    // $sql = "SELECT * FROM product_serials WHERE serial_code = '$code'";
    // ... check if exists ...
    
    else {
        echo "fake";
    }
}
?>