|
Server : Apache System : Linux p3plzcpnl507073.prod.phx3.secureserver.net 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64 User : swg98tjyzel1 ( 5098476) PHP Version : 8.1.34 Disable Function : NONE Directory : /home/swg98tjyzel1/public_html/bityatra.com/ |
Upload File : |
<?php
// Prevent direct access to config.php
if (!defined('SECURE_ACCESS')) {
die('Direct access not permitted.');
}
// -----------------------------------
// Error Reporting Configuration
// -----------------------------------
error_reporting(E_ALL);
ini_set('display_errors', 0); // Set to 1 during development if you want to see errors
ini_set('log_errors', 1);
ini_set('error_log', __DIR__ . '/error_log.txt'); // Errors will be logged to this file
// -----------------------------------
// Secure Session Handling
// -----------------------------------
if (session_status() === PHP_SESSION_NONE) {
session_start([
'use_strict_mode' => true,
'cookie_httponly' => true,
'cookie_secure' => (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on'), // Will work automatically once SSL is added
'cookie_samesite' => 'Strict'
]);
}
// -----------------------------------
// Database Configuration
// -----------------------------------
define('DB_SERVER', 'localhost');
define('DB_USER', 'bityatra_user');
define('DB_PASS', '+zOR-O{o1_8!');
define('DB_NAME', 'bityatra_db');
// -----------------------------------
// Database Connection
// -----------------------------------
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
try {
$con = new mysqli(DB_SERVER, DB_USER, DB_PASS, DB_NAME);
$con->set_charset('utf8mb4'); // Ensures proper character encoding
} catch (Exception $e) {
error_log("Database connection failed: " . $e->getMessage());
die("Database connection error. Please contact support.");
}
?>