Update & Error Pages
This commit is contained in:
parent
2c04555439
commit
8a515d6f9f
27
_conf/db.php
27
_conf/db.php
@ -1,19 +1,30 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__ . '/protect.php';
|
||||
include_once __DIR__ . '/env.php';
|
||||
|
||||
// Database configuration
|
||||
$db['host'] = $env['DB_HOST'] ?? 'localhost';
|
||||
$db['name'] = $env['DB_NAME'] ?? 'my_webapp';
|
||||
$db['user'] = $env['DB_USER'] ?? 'my_webapp';
|
||||
$db['pass'] = $env['DB_PASS'] ?? 'my_webapp_pass';
|
||||
$db['port'] = $env['DB_PORT'] ?? '3306';
|
||||
$db = [
|
||||
'host' => $env['DB_HOST'] ?? 'localhost',
|
||||
'name' => $env['DB_NAME'] ?? 'my_webapp',
|
||||
'user' => $env['DB_USER'] ?? 'my_webapp',
|
||||
'pass' => $env['DB_PASSWORD'] ?? '',
|
||||
'port' => $env['DB_PORT'] ?? '3306',
|
||||
];
|
||||
|
||||
if (!$db['host'] || !$db['name'] || !$db['user'] || !$db['pass'] || !$db['port']) {
|
||||
if (!$db['host'] || !$db['name'] || !$db['user']) {
|
||||
die("DB configuration error: missing parameters. Please check your environment variables.");
|
||||
}
|
||||
|
||||
$db['dsn'] = 'mysql:host=' . $db['host'] . ';'
|
||||
. 'port=' . $db['port'] . ';'
|
||||
. 'dbname=' . $db['name'] . ';charset=utf8mb4';
|
||||
|
||||
$db['dsn'] = 'mysql:host=' . $db['host'] . ';port='. $db['port'] .';dbname=' . $db['name'] . ';charset=utf8mb4';
|
||||
try {
|
||||
$pdo = new PDO($db['dsn'], $db['user'], $db['pass']);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (PDOException $e) {
|
||||
die("Database connection error: " . $e->getMessage());
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -1,24 +1,31 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__ . '/protect.php';
|
||||
|
||||
function loadEnv($path) {
|
||||
if (!file_exists($path)) return;
|
||||
$env = [];
|
||||
if (!file_exists($path)) return $env;
|
||||
|
||||
$lines = file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
|
||||
foreach ($lines as $line) {
|
||||
if (str_starts_with(trim($line), '#')) continue;
|
||||
|
||||
if (strpos($line, '=') === false) continue;
|
||||
|
||||
list($key, $value) = explode('=', $line, 2);
|
||||
$key = trim($key);
|
||||
$value = trim($value);
|
||||
|
||||
$env[$key] = $value;
|
||||
|
||||
putenv("$key=$value");
|
||||
$_ENV[$key] = $value;
|
||||
$_SERVER[$key] = $value;
|
||||
}
|
||||
return $env;
|
||||
}
|
||||
|
||||
loadEnv(__DIR__ . '/.env');
|
||||
$env = $_ENV;
|
||||
$env = loadEnv(__DIR__ . '/.env');
|
||||
|
||||
?>
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__ . '/protect.php';
|
||||
include_once __DIR__ . '/env.php';
|
||||
|
||||
$config['site'] = [
|
||||
|
5
_conf/index.php
Normal file
5
_conf/index.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
header('Location: /');
|
||||
|
||||
?>
|
15
_conf/protect.php
Normal file
15
_conf/protect.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
// Security: prohibits direct access to the file
|
||||
if (php_sapi_name() !== 'cli' && realpath(__FILE__) === realpath($_SERVER['SCRIPT_FILENAME'])) {
|
||||
// Send HTTP code 404
|
||||
http_response_code(404);
|
||||
|
||||
// Fallback for legacy servers (Apache, FastCGI)
|
||||
header('Status: 404 Not Found');
|
||||
|
||||
// Stops the script
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
153
admin/--edit-pwd
153
admin/--edit-pwd
@ -1,153 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
// Message d'erreur/succès
|
||||
$message = '';
|
||||
|
||||
// Traitement du formulaire
|
||||
if (isset($_POST['submit'])) {
|
||||
$new_password = $_POST['password'];
|
||||
|
||||
if (empty($new_password)) {
|
||||
$message = '<div style="color: red; margin-bottom: 15px;">Le mot de passe ne peut pas être vide!</div>';
|
||||
} else {
|
||||
// Générer le hash avec bcrypt
|
||||
$hash = password_hash($new_password, PASSWORD_BCRYPT);
|
||||
|
||||
try {
|
||||
// Connexion à la base de données
|
||||
$pdo = new PDO("mysql:host=$db_host;dbname=$db_name;charset=utf8mb4", $db_user, $db_pass);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
// Vérifier si la table admin existe
|
||||
$tables = $pdo->query("SHOW TABLES LIKE 'admin'")->fetchAll();
|
||||
|
||||
if (count($tables) === 0) {
|
||||
// Créer la table admin si elle n'existe pas
|
||||
$pdo->exec("CREATE TABLE IF NOT EXISTS `admin` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`password_hash` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;");
|
||||
|
||||
// Insérer le nouveau mot de passe
|
||||
$stmt = $pdo->prepare("INSERT INTO admin (password_hash) VALUES (?)");
|
||||
$stmt->execute([$hash]);
|
||||
} else {
|
||||
// Vérifier si un enregistrement existe déjà
|
||||
$count = $pdo->query("SELECT COUNT(*) FROM admin")->fetchColumn();
|
||||
|
||||
if ($count > 0) {
|
||||
// Mettre à jour le mot de passe existant
|
||||
$stmt = $pdo->prepare("UPDATE admin SET password_hash = ? WHERE id = 1");
|
||||
$stmt->execute([$hash]);
|
||||
} else {
|
||||
// Insérer un nouveau mot de passe
|
||||
$stmt = $pdo->prepare("INSERT INTO admin (password_hash) VALUES (?)");
|
||||
$stmt->execute([$hash]);
|
||||
}
|
||||
}
|
||||
|
||||
$message = '<div style="color: green; margin-bottom: 15px;">
|
||||
<p><strong>Mot de passe mis à jour avec succès!</strong></p>
|
||||
<p>Votre nouveau mot de passe: <strong>' . htmlspecialchars($new_password) . '</strong></p>
|
||||
<p>Hash généré: <code>' . $hash . '</code></p>
|
||||
<p><strong>IMPORTANT:</strong> Supprimez ce fichier immédiatement après utilisation!</p>
|
||||
</div>';
|
||||
|
||||
} catch (PDOException $e) {
|
||||
$message = '<div style="color: red; margin-bottom: 15px;">Erreur: ' . $e->getMessage() . '</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Mise à jour du mot de passe admin</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
line-height: 1.6;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
background-color: #f8fafc;
|
||||
}
|
||||
h1 {
|
||||
color: #4f46e5;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.card {
|
||||
background-color: white;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-weight: bold;
|
||||
}
|
||||
input[type="password"] {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
font-size: 16px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
button {
|
||||
background-color: #4f46e5;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
padding: 10px 15px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
button:hover {
|
||||
background-color: #4338ca;
|
||||
}
|
||||
.warning {
|
||||
background-color: #fee2e2;
|
||||
border-left: 4px solid #ef4444;
|
||||
padding: 10px 15px;
|
||||
margin: 20px 0;
|
||||
color: #b91c1c;
|
||||
}
|
||||
code {
|
||||
background-color: #f1f5f9;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px;
|
||||
font-family: monospace;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Mise à jour du mot de passe admin</h1>
|
||||
|
||||
<div class="warning">
|
||||
<strong>ATTENTION:</strong> Ce fichier est destiné à un usage unique. Supprimez-le immédiatement après avoir mis à jour votre mot de passe!
|
||||
</div>
|
||||
|
||||
<?php echo $message; ?>
|
||||
|
||||
<div class="card">
|
||||
<form method="post">
|
||||
<div>
|
||||
<label for="password">Nouveau mot de passe admin:</label>
|
||||
<input type="password" id="password" name="password" required>
|
||||
</div>
|
||||
<button type="submit" name="submit">Mettre à jour le mot de passe</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="warning" style="margin-top: 20px;">
|
||||
<strong>RAPPEL:</strong> N'oubliez pas de supprimer ce fichier après utilisation!
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
5
admin/assets/css/index.php
Normal file
5
admin/assets/css/index.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
header('Location: /');
|
||||
|
||||
?>
|
5
admin/assets/index.php
Normal file
5
admin/assets/index.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
header('Location: /');
|
||||
|
||||
?>
|
5
admin/assets/js/index.php
Normal file
5
admin/assets/js/index.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
header('Location: /');
|
||||
|
||||
?>
|
5
admin/edit/index.php
Normal file
5
admin/edit/index.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
header('Location: /');
|
||||
|
||||
?>
|
@ -3,14 +3,6 @@ session_start();
|
||||
include_once("../_conf/global.php");
|
||||
include_once("../_conf/db.php");
|
||||
|
||||
// Connecting to the database
|
||||
try {
|
||||
$pdo = new PDO($db['dsn'], $db['user'], $db['pass']);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (PDOException $e) {
|
||||
die("Database connection error: " . $e->getMessage());
|
||||
}v
|
||||
|
||||
// Error and success messages
|
||||
$error = '';
|
||||
$success = '';
|
5
assets/css/index.php
Normal file
5
assets/css/index.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
header('Location: /');
|
||||
|
||||
?>
|
5
assets/index.php
Normal file
5
assets/index.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
header('Location: /');
|
||||
|
||||
?>
|
41
error/401.html
Normal file
41
error/401.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 401 ?</title>
|
||||
<meta name="title" content="! Error 401 ?" />
|
||||
<meta name="description" content="A simple error 401 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 401 ?" />
|
||||
<meta property="og:description" content="A simple error 401 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 401 ?" />
|
||||
<meta property="twitter:description" content="A simple error 401 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 401</h1>
|
||||
<p class="subtitle">
|
||||
Access denied.
|
||||
<br />
|
||||
You need to log in to view this page.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
39
error/403.html
Normal file
39
error/403.html
Normal file
@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 403 ?</title>
|
||||
<meta name="title" content="! Error 403 ?" />
|
||||
<meta name="description" content="A simple error 403 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 403 ?" />
|
||||
<meta property="og:description" content="A simple error 403 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 403 ?" />
|
||||
<meta property="twitter:description" content="A simple error 403 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 403</h1>
|
||||
<p class="subtitle">
|
||||
Sorry, you don’t have permission to access this page.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
41
error/404.html
Normal file
41
error/404.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 404 ?</title>
|
||||
<meta name="title" content="! Error 404 ?" />
|
||||
<meta name="description" content="A simple error 404 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 404 ?" />
|
||||
<meta property="og:description" content="A simple error 404 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 404 ?" />
|
||||
<meta property="twitter:description" content="A simple error 404 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 404</h1>
|
||||
<p class="subtitle">
|
||||
Oops! The page you’re looking for doesn’t exist or has been moved.
|
||||
<br />
|
||||
Let’s get you back on track.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
41
error/405.html
Normal file
41
error/405.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 405 ?</title>
|
||||
<meta name="title" content="! Error 405 ?" />
|
||||
<meta name="description" content="A simple error 405 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 405 ?" />
|
||||
<meta property="og:description" content="A simple error 405 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 405 ?" />
|
||||
<meta property="twitter:description" content="A simple error 405 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 405</h1>
|
||||
<p class="subtitle">
|
||||
The method used is not allowed for this resource.
|
||||
<br />
|
||||
Please check and try another method.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
41
error/408.html
Normal file
41
error/408.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 408 ?</title>
|
||||
<meta name="title" content="! Error 408 ?" />
|
||||
<meta name="description" content="A simple error 408 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 408 ?" />
|
||||
<meta property="og:description" content="A simple error 408 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 408 ?" />
|
||||
<meta property="twitter:description" content="A simple error 408 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 408</h1>
|
||||
<p class="subtitle">
|
||||
Your request took too long to complete.
|
||||
<br />
|
||||
Please try again.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
41
error/413.html
Normal file
41
error/413.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 413 ?</title>
|
||||
<meta name="title" content="! Error 413 ?" />
|
||||
<meta name="description" content="A simple error 413 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 413 ?" />
|
||||
<meta property="og:description" content="A simple error 413 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 413 ?" />
|
||||
<meta property="twitter:description" content="A simple error 413 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 413</h1>
|
||||
<p class="subtitle">
|
||||
The data you sent is too big.
|
||||
<br />
|
||||
Try reducing the size and retrying.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
41
error/414.html
Normal file
41
error/414.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 414 ?</title>
|
||||
<meta name="title" content="! Error 414 ?" />
|
||||
<meta name="description" content="A simple error 414 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 414 ?" />
|
||||
<meta property="og:description" content="A simple error 414 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 414 ?" />
|
||||
<meta property="twitter:description" content="A simple error 414 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 414</h1>
|
||||
<p class="subtitle">
|
||||
The URL is too long to be processed.
|
||||
<br />
|
||||
Please shorten the link or try a different one.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
39
error/415.html
Normal file
39
error/415.html
Normal file
@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 415 ?</title>
|
||||
<meta name="title" content="! Error 415 ?" />
|
||||
<meta name="description" content="A simple error 415 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 415 ?" />
|
||||
<meta property="og:description" content="A simple error 415 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 415 ?" />
|
||||
<meta property="twitter:description" content="A simple error 415 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 415</h1>
|
||||
<p class="subtitle">
|
||||
The media type you sent is not supported by this server.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
41
error/429.html
Normal file
41
error/429.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 429 ?</title>
|
||||
<meta name="title" content="! Error 429 ?" />
|
||||
<meta name="description" content="A simple error 429 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 429 ?" />
|
||||
<meta property="og:description" content="A simple error 429 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 429 ?" />
|
||||
<meta property="twitter:description" content="A simple error 429 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 429</h1>
|
||||
<p class="subtitle">
|
||||
Slow down! You’ve sent too many requests.
|
||||
<br />
|
||||
Please wait and try again later.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
41
error/500.html
Normal file
41
error/500.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 500 ?</title>
|
||||
<meta name="title" content="! Error 500 ?" />
|
||||
<meta name="description" content="A simple error 500 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 500 ?" />
|
||||
<meta property="og:description" content="A simple error 500 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 500 ?" />
|
||||
<meta property="twitter:description" content="A simple error 500 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 500</h1>
|
||||
<p class="subtitle">
|
||||
Whoops! Something went wrong on our side.
|
||||
<br />
|
||||
We’re on it, try again soon.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
37
error/501.html
Normal file
37
error/501.html
Normal file
@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 501 ?</title>
|
||||
<meta name="title" content="! Error 501 ?" />
|
||||
<meta name="description" content="A simple error 501 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 501 ?" />
|
||||
<meta property="og:description" content="A simple error 501 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 501 ?" />
|
||||
<meta property="twitter:description" content="A simple error 501 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 501</h1>
|
||||
<p class="subtitle">This feature is not supported by the server yet.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
41
error/502.html
Normal file
41
error/502.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 502 ?</title>
|
||||
<meta name="title" content="! Error 502 ?" />
|
||||
<meta name="description" content="A simple error 502 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 502 ?" />
|
||||
<meta property="og:description" content="A simple error 502 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 502 ?" />
|
||||
<meta property="twitter:description" content="A simple error 502 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 502</h1>
|
||||
<p class="subtitle">
|
||||
Bad response from an upstream server.
|
||||
<br />
|
||||
Please try again later.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
41
error/503.html
Normal file
41
error/503.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 503 ?</title>
|
||||
<meta name="title" content="! Error 503 ?" />
|
||||
<meta name="description" content="A simple error 503 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 503 ?" />
|
||||
<meta property="og:description" content="A simple error 503 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 503 ?" />
|
||||
<meta property="twitter:description" content="A simple error 503 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 503</h1>
|
||||
<p class="subtitle">
|
||||
The server is temporarily unavailable.
|
||||
<br />
|
||||
Please try again shortly.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
41
error/504.html
Normal file
41
error/504.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>! Error 504 ?</title>
|
||||
<meta name="title" content="! Error 504 ?" />
|
||||
<meta name="description" content="A simple error 504 page..." />
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
<meta property="og:title" content="! Error 504 ?" />
|
||||
<meta property="og:description" content="A simple error 504 page..." />
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="<?php echo $url; ?>" />
|
||||
<meta property="twitter:title" content="! Error 504 ?" />
|
||||
<meta property="twitter:description" content="A simple error 504 page..." />
|
||||
<meta name="robots" content="nofollow, noindex" />
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
|
||||
<!-- Font Awesome for icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
/>
|
||||
<!-- jQuery for drag and drop functionality -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">Error 504</h1>
|
||||
<p class="subtitle">
|
||||
The server took too long to respond.
|
||||
<br />
|
||||
Please try again later.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
10
services.php
10
services.php
@ -2,14 +2,6 @@
|
||||
include_once("./_conf/global.php");
|
||||
include_once("./_conf/db.php");
|
||||
|
||||
// Connecting to the database
|
||||
try {
|
||||
$pdo = new PDO($db['dsn'], $db['user'], $db['pass']);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (PDOException $e) {
|
||||
die("Database connection error: " . $e->getMessage());
|
||||
}
|
||||
|
||||
// Retrieving services from the database
|
||||
try {
|
||||
$stmt = $pdo->query("SELECT * FROM services ORDER BY order_num ASC");
|
||||
@ -29,7 +21,7 @@ $edit_mode = isset($_GET['edit']);
|
||||
|
||||
// If you are in edit mode, redirect to edit-services
|
||||
if ($edit_mode) {
|
||||
header('Location: admin/edit-services');
|
||||
header('Location: admin/edit/services');
|
||||
exit;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user