File manager - Edit - /home/aissorg/public_html/images/axdgdfg/sgdfssfdgsd/login.php.tar
Back
home/aissorg/public_html/login.php 0000644 00000011237 15117333305 0013273 0 ustar 00 <?php session_start(); include 'admin/include/config.php'; // Include database connection $alertMessage = ""; // Initialize alert message variable if ($_SERVER["REQUEST_METHOD"] == "POST") { $username = trim($_POST['username']); $password = trim($_POST['password']); // Check if user exists $query = "SELECT id, first_name, last_name, email, phone_number, password FROM users WHERE email = ? OR phone_number = ?"; if ($stmt = $con->prepare($query)) { $stmt->bind_param("ss", $username, $username); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows == 1) { $user = $result->fetch_assoc(); // Verify the password if (password_verify($password, $user['password'])) { $_SESSION['user_id'] = $user['id']; $_SESSION['user_name'] = $user['first_name'] . " " . $user['last_name']; // Show success message $alertMessage = '<div class="alert alert-success" id="successAlert">Login Successful!</div>'; } else { $alertMessage = '<div class="alert alert-danger">Incorrect password. Please try again.</div>'; } } else { $alertMessage = '<div class="alert alert-danger">No account found with this email or phone number.</div>'; } } } ?> <!DOCTYPE html> <html class="wide wow-animation" lang="en"> <head> <title>Login</title> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=device-width height=device-height initial-scale=1.0 maximum-scale=1.0 user-scalable=0"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="utf-8"> <link rel="icon" href="img/favicon.png" type="image/x-icon"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400..700;1,400..700&family=DM+Serif+Display&family=Noto+Serif:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet"> <link rel="stylesheet" href="css/bootstrap.css"> <link rel="stylesheet" href="css/fonts.css"> <link rel="stylesheet" href="css/style.css" id="main-styles-link"> <link rel="stylesheet" href="css/about.css"> <link rel="stylesheet" href="css/custom.css"> </head> <body> <div class="page"> <?php include('includes/header.php'); ?> <section class="breadcrumbs-custom bg-image context-dark" style="background-image: url(img/common_banner.jpg);"> <div class="breadcrumbs-custom-inner"> <div class="container breadcrumbs-custom-container"> <div class="breadcrumbs-custom-main"> <h3 class="breadcrumbs-custom-title" style="color: #fff;">Login</h3> </div> <ul class="breadcrumbs-custom-path"> <li><a href="./">Home</a></li> <li class="active">Login</li> </ul> </div> </div> </section> <!-- Success Alert --> <!-- Success Alert (Hidden Initially) --> <section class="section section-lg oh"> <div class="container"> <!-- Login Form --> <div class="login-container"> <h3 class="bg-color-theme">Login</h3> <!-- Success Alert --> <?php echo $alertMessage; ?> <form action="#" id="loginForm"> <label for="username"></label> <input type="text" name="username" class="input-line" placeholder="Username" required><br> <input type="password" name="password" class="input-line" placeholder="Password" required><br> <button type="submit" class="login-btn">Login</button> </form> <p class="info-message">Don't have an account? Please <a href="register.php" style="color: #8B0000;"><u>Register Here</u></a>.</p> </div> </div> </section> <?php include('includes/footer.php'); ?> </div> <div class="snackbars" id="form-output-global"></div> <script src="js/core.min.js"></script> <script src="js/script.js"></script> <script> setTimeout(function() { let successAlert = document.getElementById('successAlert'); if (successAlert) { successAlert.style.display = 'none'; } }, 3000); // Hide after 3 seconds </script> </body> </html>