Show sourcecode
The following files exists in this folder. Click to view.
config.php
connect_db.php
db_manager.php
footer.php
head.php
header.php
login_check.php
config.php
39 lines UTF-8 Windows (CRLF)
<?php
/* =========================
PHP-felhantering
========================= */
error_reporting(-1); // Rapportera alla typer av fel
ini_set('display_errors', 1); // Visa fel i webbläsaren
ini_set('output_buffering', 0); // Skriv direkt, ej buffring
/* =========================
Databasinställningar
========================= */
$remote = true; // Ändra till true för fjärrdatabas
$cleanup = false; // Ändra till true för att nollställa tabellerna (byt tillbaka till false direkt efter)
if (!$remote) {
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "mydb";
} else {
$servername = "localhost";
$username = "pavvor23";
$password = "z8_asVQU";
$dbname = "pavvor23";
}
/* =========================
Starta session med säkerhetsparametrar
========================= */
session_set_cookie_params([
'lifetime' => 3600, // 1 timme
'path' => '/',
'secure' => $remote, // endast HTTPS vid remote
'httponly' => true, // ej tillgänglig via JS
'samesite' => 'Lax', // begränsar cross-site
]);
session_start();
?>