Files
QRForge-selfhosted/src/read.php
T
2024-04-18 20:33:20 +02:00

25 lines
647 B
PHP

<?php
include 'config/config.php';
if($_SERVER["REQUEST_METHOD"] !== "GET" || !isset($_GET['id']))
die("Method not allowed. Check id parameter");
$db = getDbInstance();
$db->where("identifier", $_GET['id']);
$qrcode = $db->getOne("dynamic_qrcodes");
$data = array (
'scan' => $db->inc(1)
);
$db->where("identifier", $_GET['id']);
$db->update ('dynamic_qrcodes', $data);
if($qrcode['state'] == 'enable'){
echo '<meta http-equiv="refresh" content="0; URL='.$qrcode['link'].'" />';
echo 'Loading...'; // You can include a custom page to display during the redirect
}
else
echo 'Disabled link';
?>