35 lines
843 B
PHP
35 lines
843 B
PHP
<?php
|
|
require_once 'db/config.php';
|
|
|
|
$slug = $_GET['slug'] ?? '';
|
|
|
|
if (!$slug) {
|
|
die("Campaign not found.");
|
|
}
|
|
|
|
$pdo = db();
|
|
$stmt = $pdo->prepare("SELECT * FROM campaigns WHERE slug = ? AND is_active = TRUE");
|
|
$stmt->execute([$slug]);
|
|
$campaign = $stmt->fetch();
|
|
|
|
if (!$campaign) {
|
|
die("Campaign not found or inactive.");
|
|
}
|
|
|
|
// Log view
|
|
$stmt = $pdo->prepare("INSERT INTO stats (campaign_id, type) VALUES (?, 'view')");
|
|
$stmt->execute([$campaign['id']]);
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head><title>Verify Age</title></head>
|
|
<body>
|
|
<div style="text-align: center; padding-top: 50px;">
|
|
<h1>Please Verify Your Age</h1>
|
|
<p>This content is for adults only.</p>
|
|
<button onclick="window.location.href='verify_action.php?slug=<?php echo htmlspecialchars($slug); ?>'">Yes, I am 18+</button>
|
|
</div>
|
|
</body>
|
|
</html>
|