System QR hi24.pl

System działa poprawnie.

"; exit; } $stmt = $pdo->prepare("SELECT * FROM codes WHERE code = ?"); $stmt->execute([$code]); $row = $stmt->fetch(); if (!$row) { http_response_code(404); die("

Błąd 404

Ten kod QR nie istnieje.

"); } if ($row['status'] === 'active' && !empty($row['target_url'])) { header("Location: " . $row['target_url']); exit; } $msg = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['url'])) { $url = trim($_POST['url']); // Dodaj protokół, jeśli użytkownik go pominął if (!preg_match("~^(?:f|ht)tps?://~i", $url)) $url = "https://" . $url; if (filter_var($url, FILTER_VALIDATE_URL)) { $update = $pdo->prepare("UPDATE codes SET target_url = ?, status = 'active' WHERE id = ?"); $update->execute([$url, $row['id']]); echo '

🎉 Gotowe!

Kod aktywowany. Przekierowanie...

'; exit; } else { $msg = "Podany adres jest nieprawidłowy."; } } ?> Aktywacja Kodu QR

Aktywuj swój kod

Kod QR:

$msg

"; ?>