One Hat Cyber Team
Your IP :
18.216.67.94
Server IP :
50.28.103.30
Server :
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software :
nginx/1.24.0
PHP Version :
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
sd.electronharmony.com
/
Edit File:
login.php
<?php // 开启会话 session_start(); // 检查是否已经登录 if (isset($_SESSION['user_email'])) { header("Location: index.php"); exit(); } ?> <!DOCTYPE html> <html lang="zxx"> <head> <meta charset="utf-8" /> <meta http-equiv="x-ua-compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0 user-scalable=no"/> <meta name="description" content="Fully Responsive Admin & Dashboard Template" /> <meta name="keyword" content="" /> <meta name="author" content="WRAPCODERS" /> <!--! The above 6 meta tags *must* come first in the head; any other head content must come *after* these tags !--> <!--! BEGIN: Google Fonts !--><link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <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=Inter:wght@100..900&family=Public+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet" /> <!--! END: Google Fonts !--> <!--! BEGIN: Favicon !--> <link rel="shortcut icon" type="image/x-icon" href="assets/images/favicon.ico" /> <!--! END: Favicon !--> <!--! BEGIN: Apps Title !--> <title>Login</title> <!--! END: Apps Title !--> <!--! BEGIN: Page Vendors -!--> <!--! END: Page Vendors -!--> <!--! BEGIN: MatisMenu CSS -!--> <link rel="stylesheet" href="assets/vendors/metismenu/metisMenu.min.css"> <!--! END: MatisMenu CSS -!--> <!--! BEGIN: Flaticon CSS -!--> <link rel="stylesheet" href="assets/vendors/@flaticon/flaticon-uicons/css/all/all.css"> <!--! END: Flaticon CSS -!--> <!--! BEGIN: Theme CSS -!--> <link rel="stylesheet" type="text/css" href="assets/css/theme.min.css"> <!--! END: Theme CSS -!--> <!--! Start:: Color Modes JS -!--> <script src="assets/js/color-modes.min.js"></script> <!--! End:: Color Modes JS -!--> <!--! HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries !--> <!--! WARNING: Respond.js doesn"t work if you view the page via file: !--> <!--[if lt IE 9]> <script src="https:oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https:oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <!--! ================================================================ !--> <!--! Start:: Main Wrapper !--> <!--! ================================================================ !--> <div class="main-wrapper"> <main class="min-vh-100 overflow-y-auto d-flex flex-column justify-content-center px-4 m-0" id="edash-main" > <div class="card max-wd-400 max-wd-sm-450 mx-auto my-5 bg-body-tertiary" > <div class="card-body p-sm-8 p-4"> <h4 class="mb-2 fw-semibold">Login to your account</h4> <p class="fs-13 fw-medium text-muted mb-6"> Welcome back </p> <?php session_start(); if ($_SERVER["REQUEST_METHOD"] == "POST") { // Database connection $servername = "localhost"; $username = "t001"; $password = "ZRTsRb6Ycp585AEC"; $dbname = "t001"; $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // Retrieve and sanitize input $email = $conn->real_escape_string($_POST['email']); $password = $conn->real_escape_string($_POST['password']); // Check if the user exists in the database $sql = "SELECT * FROM user WHERE emails = '$email'"; $result = $conn->query($sql); if ($result->num_rows > 0) { $row = $result->fetch_assoc(); if (password_verify($password, $row['passwords'])) { // Password is correct $_SESSION['user_email'] = $email; echo "<div class='alert alert-success'>Login successful. Welcome, $email!</div>"; // Redirect to the dashboard or another page header("Location: index.php"); // exit(); } else { // Password is incorrect echo "<div class='alert alert-danger'>Invalid password.</div>"; } } else { // User not found echo "<div class='alert alert-danger'>No user found with this email.</div>"; } $conn->close(); } ?> <form method="POST" action=""> <div class="mb-4"> <input type="email" name="email" class="form-control" placeholder="Email" required /> </div> <div class="mb-3"> <input type="password" name="password" class="form-control" placeholder="Password" required /> </div> <div class="d-flex align-items-center justify-content-between"> <div class="form-check"> <input class="form-check-input cursor-pointer" type="checkbox" id="rememberMe" /> <label class="form-check-label text-muted" for="rememberMe">Remember</label> </div> <a class="fs-13 text-primary">Forgot password?</a> </div> <div class="d-grid mt-5"> <button type="submit" class="btn btn-lg btn-primary w-100">Login</button> </div> </form> <div class="w-100 mt-5 text-center mx-auto"> <div class="my-5 border-bottom position-relative"> <span class="small py-1 px-3 text-uppercase text-muted bg-body-tertiary rounded position-absolute translate-middle" >or</span > </div> <div class="d-flex align-items-center justify-content-center gap-2" > <a href="javascript:void(0);" class="btn bg-body-tertiary flex-fill border" data-bs-toggle="tooltip" data-bs-trigger="hover" title="Login with Facebook" > <i class="fi fi-brands-facebook"></i> </a> <a href="javascript:void(0);" class="btn bg-body-tertiary flex-fill border" data-bs-toggle="tooltip" data-bs-trigger="hover" title="Login with Twitter" > <i class="fi fi-brands-twitter"></i> </a> <a href="javascript:void(0);" class="btn bg-body-tertiary flex-fill border" data-bs-toggle="tooltip" data-bs-trigger="hover" title="Login with Github" > <i class="fi fi-brands-github"></i> </a> </div> </div> <div class="mt-5 text-muted"> <span> Don't have an account?</span> <a href="" class="fw-semibold text-dark" >Create an Account</a > </div> </div> </div> </main> </div> <!--! ================================================================ !--> <!--! End:: Main Wrapper !--> <!--! ================================================================ !--> <!--! ================================================================ !--> <!--! Footer Script !--> <!--! ================================================================ !--> <!--! BEGIN: Common Vendors !--> <script src="assets/js/vendors.min.js"></script> <!--! END: Common Vendors !--> <!--! BEGIN: Apps Common Init !--> <script src="assets/js/common-init.min.js"></script> <!--! END: Apps Common Init !--> </body> </html>
Simpan