/
/
home
/
u523034047
/
domains
/
nainitalfloweritech.com
/
public_html
/
admin
Server: in-mum-web1112.main-hosting.eu (62.72.28.111)
You: 216.73.216.89
PHP 8.3.16
Dir:
/home/u523034047/domains/nainitalfloweritech.com/public_html/admin
Edit:
/home/u523034047/domains/nainitalfloweritech.com/public_html/admin/index.php
<?php session_start(); include("include/config.php"); if(isset($_POST['submit'])) { $username = trim($_POST['username']); $password = md5($_POST['password']); // MD5 password $stmt = $con->prepare("SELECT id, username FROM admin WHERE username=? AND password=?"); $stmt->bind_param("ss", $username, $password); $stmt->execute(); $result = $stmt->get_result(); if($row = $result->fetch_assoc()) { session_regenerate_id(true); $_SESSION['alogin'] = $row['username']; $_SESSION['id'] = $row['id']; // 🔥 LOGIN SUCCESS → MANAGE PRODUCTS header("Location: manage-products.php"); exit(); } else { $_SESSION['errmsg'] = "Invalid username or password"; header("Location: index.php"); exit(); } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Admin Login | Shopping Portal</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet"> <style> body{ min-height:100vh; background: linear-gradient(135deg, #667eea, #764ba2); display:flex; align-items:center; justify-content:center; font-family: 'Segoe UI', sans-serif; } .login-card{ background:#fff; border-radius:12px; box-shadow:0 15px 40px rgba(0,0,0,.2); width:100%; max-width:380px; } .login-header{ background:#4f46e5; color:#fff; padding:20px; text-align:center; border-radius:12px 12px 0 0; } .login-body{ padding:25px; } .form-control{ height:45px; } .btn-login{ background:#4f46e5; border:none; height:45px; } .btn-login:hover{ background:#4338ca; } .footer-text{ font-size:13px; text-align:center; margin-top:15px; color:#666; } </style> </head> <body> <div class="login-card"> <div class="login-header"> <h4><i class="fa-solid fa-user-shield"></i> Admin Login</h4> <small>Shopping Portal</small> </div> <div class="login-body"> <?php if(!empty($_SESSION['errmsg'])){ ?> <div class="alert alert-danger text-center"> <?php echo $_SESSION['errmsg']; $_SESSION['errmsg']=""; ?> </div> <?php } ?> <form method="post"> <div class="mb-3"> <label class="form-label">Username</label> <div class="input-group"> <span class="input-group-text"><i class="fa fa-user"></i></span> <input type="text" name="username" class="form-control" placeholder="Enter username" required> </div> </div> <div class="mb-3"> <label class="form-label">Password</label> <div class="input-group"> <span class="input-group-text"><i class="fa fa-lock"></i></span> <input type="password" name="password" class="form-control" placeholder="Enter password" required> </div> </div> <button type="submit" name="submit" class="btn btn-primary btn-login w-100"> <i class="fa fa-sign-in-alt"></i> Login </button> </form> <div class="footer-text"> © <?php echo date('Y'); ?> Shopping Portal </div> </div> </div> </body> </html>
Ukuran: 3.6 KB