Rippchen/db_connection.php
2025-04-15 20:29:16 +02:00

17 lines
467 B
PHP

<?php
$databaseFile = 'rippchen.db'; // Path to your SQLite database file
try {
$db = new PDO("sqlite:" . $databaseFile);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
die("Database connection failed: " . $e->getMessage());
}
// Function to sanitize user input (remains the same)
function sanitize_input($data) {
$data = trim($data);
$data = stripslashes($data);
return htmlspecialchars($data);
}