���� JFIF aewtgwgerwasdasd
Server IP : 147.93.80.58 / Your IP : 216.73.216.195 Web Server : LiteSpeed System : Linux id-dci-web1866.main-hosting.eu 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64 User : u939086737 ( 939086737) PHP Version : 8.2.28 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u939086737/domains/mishrahometutor.in/public_html/admin/ |
Upload File : |
<?php ini_set('session.cookie_secure', '1'); // Send cookie only over HTTPS ini_set('session.cookie_httponly', '1'); // Prevent JavaScript access to session cookie ini_set('session.use_strict_mode', '1'); // Reject uninitialized session IDs ini_set('session.cookie_samesite', 'Strict'); // Prevent cross-site request session_start(); if (!isset($_SESSION['admin_id'])) { header("Location: ./"); exit; } include '../action/config.php'; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['admin_change_password'])) { $adminId = $_SESSION['admin_id']; $oldPassword = $_POST['old_password']; $newPassword = $_POST['new_password']; $confirmPassword = $_POST['confirm_password']; // Fetch the current password hash from the database $stmt = $pdo->prepare("SELECT password FROM admin WHERE id = :id"); $stmt->execute([':id' => $adminId]); $admin = $stmt->fetch(); if ($newPassword !== $confirmPassword) { $error_msg = "New password and confirm password do not match."; } else if (!$admin) { $error_msg = "Admin not found."; } else if (!password_verify($oldPassword, $admin['password'])) { $error_msg = "Old password is incorrect."; } else { // Hash the new password $newPasswordHash = password_hash($newPassword, PASSWORD_BCRYPT); $updateStmt = $pdo->prepare("UPDATE admin SET password = :password, pass_text=:new_pass WHERE id = :id"); $updateStmt->execute([ ':password' => $newPasswordHash, ':new_pass' => $newPassword, ':id' => $adminId, ]); $success_msg = "Password changed successfully."; } } ?> <!doctype html> <html lang="en" class="semi-dark"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!--favicon--> <link rel="icon" href="assets/images/favicon-32x32.png" type="image/png" /> <!--plugins--> <link href="assets/plugins/notifications/css/lobibox.min.css" rel="stylesheet" /> <link href="assets/plugins/vectormap/jquery-jvectormap-2.0.2.css" rel="stylesheet" /> <link href="assets/plugins/simplebar/css/simplebar.css" rel="stylesheet" /> <link href="assets/plugins/perfect-scrollbar/css/perfect-scrollbar.css" rel="stylesheet" /> <link href="assets/plugins/metismenu/css/metisMenu.min.css" rel="stylesheet" /> <!-- loader--> <link href="assets/css/pace.min.css" rel="stylesheet" /> <script src="assets/js/pace.min.js"></script> <!-- Bootstrap CSS --> <link href="assets/css/bootstrap.min.css" rel="stylesheet"> <link href="assets/css/bootstrap-extended.css" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet"> <link href="assets/css/app.css" rel="stylesheet"> <link href="assets/css/icons.css" rel="stylesheet"> <!-- Theme Style CSS --> <link rel="stylesheet" href="assets/css/dark-theme.css" /> <link rel="stylesheet" href="assets/css/semi-dark.css" /> <link rel="stylesheet" href="assets/css/header-colors.css" /> <title><?= $page . " | " . $shop ?> </title> <style> img#imagePreview { max-width: 100%; max-height: 300px; margin-top: 10px; } .form-label { margin-bottom: 0; } </style> </head> <body> <!--wrapper--> <div class="wrapper"> <?php include './header.php' ?> <!--start page wrapper --> <div class="page-wrapper"> <div class="page-content"> <!--breadcrumb--> <div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3"> <div class="ps-3"> <nav aria-label="breadcrumb"> <ol class="breadcrumb mb-0 p-0"> <li class="breadcrumb-item"><a href="javascript:;"><i class="bx bx-home-alt"></i></a> </li> <li class="breadcrumb-item active" aria-current="page"><?= $page ?></li> </ol> </nav> </div> </div> <!--end breadcrumb--> <div class="row"> <div class="col-lg-8 p-4" style="border:1px solid red; border-radius: 10px;"> <div class="card card-header text-center"> <b class="text-danger"><?= (isset($error_msg) ? $error_msg : '') ?></b> <b class="text-success"><?= (isset($success_msg) ? $success_msg : '') ?></b> </div> <form class="" id="blogForm" method="POST" enctype="multipart/form-data"> <div class="mb-3"> <label for="title" class="form-label">Title</label> <input type="text" class="form-control" id="title" name="title" required> </div> <div class="mb-3"> <label for="slug" class="form-label">Slug</label> <input type="text" class="form-control" id="slug" name="slug" readonly required> </div> <div class="mb-3"> <label for="content" class="form-label">Content</label> <textarea class="form-control" id="content" name="content" required></textarea> </div> <div class="mb-3"> <label for="image" class="form-label">Feature Image</label> <input type="file" class="form-control" id="image" name="image" accept="image/*" required> <img id="imagePreview" alt="Image Preview" /> </div> <div class="mb-3"> <label for="metaTitle" class="form-label">Meta Title</label> <input type="text" class="form-control" id="metaTitle" name="meta_title" maxlength="255" required> </div> <div class="mb-3"> <label for="metaDescription" class="form-label">Meta Description</label> <textarea class="form-control" id="metaDescription" name="meta_description" maxlength="500" required></textarea> </div> <div class="mb-3"> <label for="metaKeywords" class="form-label">Meta Keywords</label> <input type="text" class="form-control" id="metaKeywords" name="meta_keywords" placeholder="e.g., blog, tutorial, PHP" required> </div> <div class="mb-3"> <label for="author" class="form-label">Author</label> <input type="text" class="form-control" id="author" name="author" value="Admin" required> </div> <button type="submit" name="add_blog_type" value="draft" class="btn btn-info">Save Draft</button> <button type="submit" name="add_blog_type" value="save-and-publish" class="btn btn-success">Save & Publish</button> </form> </div> </div> </div> </div> <?php include './footer.php' ?> </div> <!--end wrapper--> <!-- Bootstrap JS --> <script src="assets/js/bootstrap.bundle.min.js"></script> <!--plugins--> <script src="assets/js/jquery.min.js"></script> <script src="assets/plugins/simplebar/js/simplebar.min.js"></script> <script src="assets/plugins/metismenu/js/metisMenu.min.js"></script> <script src="assets/plugins/perfect-scrollbar/js/perfect-scrollbar.js"></script> <script src="assets/plugins/vectormap/jquery-jvectormap-2.0.2.min.js"></script> <script src="assets/plugins/vectormap/jquery-jvectormap-world-mill-en.js"></script> <script src="assets/plugins/chartjs/js/chart.js"></script> <script src="assets/plugins/sparkline-charts/jquery.sparkline.min.js"></script> <!--notification js --> <script src="assets/plugins/notifications/js/lobibox.min.js"></script> <script src="assets/plugins/notifications/js/notifications.min.js"></script> <script src="assets/js/index3.js"></script> <!--app JS--> <script src="assets/js/app.js"></script> <script src="https://cdn.ckeditor.com/4.21.0/standard/ckeditor.js"></script> <script> // Initialize CKEditor for content editing CKEDITOR.replace('content'); // Generate slug automatically document.getElementById('title').addEventListener('input', function() { const title = this.value; const slug = title.toLowerCase() .replace(/[^a-z0-9\s-]/g, '') // Remove invalid characters .replace(/\s+/g, '-') // Replace spaces with hyphens .replace(/-+/g, '-'); // Replace multiple hyphens with single document.getElementById('slug').value = slug; }); // Image preview document.getElementById('image').addEventListener('change', function() { const file = this.files[0]; if (file) { const reader = new FileReader(); reader.onload = function(e) { document.getElementById('imagePreview').src = e.target.result; }; reader.readAsDataURL(file); } }); </script> </body> </html>