<?php
// Database configuration
define('DB_HOST', 'localhost');
define('DB_USER', 'risk7252_logbook-ppds');
define('DB_PASS', 'Arfaarsya2722*');
define('DB_NAME', 'risk7252_logbook-ppds');

try {
    $conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
    
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    }
    
    $conn->set_charset("utf8");
} catch (Exception $e) {
    die("Database connection error: " . $e->getMessage());
}

// Sanitize input
function sanitize($input) {
    return htmlspecialchars(trim($input), ENT_QUOTES, 'UTF-8');
}
?>
