Code restructure push

This commit is contained in:
twotalesanimation
2025-12-04 15:09:44 +02:00
parent 86faad7a78
commit be2b757f4e
111 changed files with 17297 additions and 19420 deletions

39
src/pages/auth/verify.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
$rootPath = dirname(dirname(dirname(__DIR__)));
require_once($rootPath . '/src/config/env.php');
require_once($rootPath . '/src/config/connection.php');
require_once($rootPath . '/src/config/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();
?>