Files
4WDCSA.co.za/verify.php
Local Administrator b83134aca3 Initial commit
2025-04-18 10:32:42 +02:00

38 lines
843 B
PHP

<?php
require_once("connection.php");
require_once("functions.php");
// Create connection
$conn = openDatabaseConnection();
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Verify token
if (isset($_GET['token'])) {
$token = $conn->real_escape_string($_GET['token']);
// Prepare and execute query
$stmt = $conn->prepare('UPDATE users SET is_verified = 1 WHERE token = ?');
$stmt->bind_param('s', $token);
if ($stmt->execute()) {
if ($stmt->affected_rows > 0) {
header('Location: login.php');
} else {
header('Location: login.php');
}
} else {
echo 'Error: ' . $stmt->error;
}
$stmt->close();
} else {
echo 'No token provided.';
}
$conn->close();
?>