mirror of
https://git.sr.ht/~iwakuralain/text0Nly
synced 2025-07-27 15:36:11 +00:00
fixin...
This commit is contained in:
parent
f51b543ac2
commit
52f206cc38
@ -9,6 +9,7 @@ header('Content-Security-Policy: default-src \'self\'; style-src \'self\' \'unsa
|
|||||||
header('Strict-Transport-Security: max-age=31536000; includeSubDomains');
|
header('Strict-Transport-Security: max-age=31536000; includeSubDomains');
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
try {
|
||||||
$config = require 'config.php';
|
$config = require 'config.php';
|
||||||
$db = new PDO(
|
$db = new PDO(
|
||||||
"mysql:host={$config['db']['host']};dbname={$config['db']['name']}",
|
"mysql:host={$config['db']['host']};dbname={$config['db']['name']}",
|
||||||
@ -16,6 +17,10 @@ $db = new PDO(
|
|||||||
$config['db']['pass']
|
$config['db']['pass']
|
||||||
);
|
);
|
||||||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
error_log("Database connection error: " . $e->getMessage());
|
||||||
|
die("Database connection error");
|
||||||
|
}
|
||||||
|
|
||||||
$error = '';
|
$error = '';
|
||||||
$success = '';
|
$success = '';
|
||||||
@ -51,6 +56,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
$error = 'User not found';
|
$error = 'User not found';
|
||||||
}
|
}
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
|
error_log("Login error: " . $e->getMessage());
|
||||||
$error = 'Server error';
|
$error = 'Server error';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user