/
/
home
/
u523034047
/
domains
/
gmcrudrapur.com
/
public_html
/
admin
Server: in-mum-web1112.main-hosting.eu (62.72.28.111)
You: 216.73.216.4
PHP 8.3.16
Dir:
/home/u523034047/domains/gmcrudrapur.com/public_html/admin
Edit:
/home/u523034047/domains/gmcrudrapur.com/public_html/admin/index.php
<?php include('conn.php'); $msg = ""; if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) { $email = trim($_POST['Email']); $password = md5(trim($_POST['Password'])); // Hash password using MD5 // Use prepared statements to prevent SQL injection $stmt = $connection->prepare("SELECT * FROM login WHERE email = ? AND password = ?"); $stmt->bind_param("ss", $email, $password); $stmt->execute(); $result = $stmt->get_result(); if ($result && $result->num_rows > 0) { session_start(); $_SESSION['username'] = $email; header('Location: dashboard.php'); exit(); } else { $msg = "Invalid email or password."; } $stmt->close(); } ?> <!DOCTYPE html> <html lang="en"> <head></head> <title>Admin</title> <!-- Meta tag Keywords --> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script> <!-- Meta tag Keywords --> <!-- css files --> <link href="css/style.css" rel="stylesheet" type="text/css" media="all"> <!-- online-fonts --> <link href="//fonts.googleapis.com/css?family=Roboto+Slab:100,300,400,700Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900iSlabo+27px&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese" rel="stylesheet"> <!--//online-fonts --> <body> <!--header--> <div class="agileheader"> <h1>Admin Panel</h1> </div> <!--//header--> <!--main--> <div class="main-w3l"> <div class="w3layouts-main"> <h2>Login Now</h2> <p style="color:orange;"><?php echo $msg;?></p> <form action="" method="post"> <input value="E-MAIL" name="Email" type="email" required="" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'E-Mail';}"/> <input value="PASSWORD" name="Password" type="password" required="" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'password';}"/> <div class="clear"></div> <input type="submit" value="login" name="login"> </form> </div> </div> <!--//main--> <!--footer--> <div class="footer-w3l"> 2017</a> </div> <!--//footer--> </body> </html>
Ukuran: 2.4 KB