prepare($sql); $stmt->bind_param("s", $username); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { $user = $result->fetch_assoc(); if (password_verify($password, $user['password'])) { // Successful login $_SESSION['username'] = $user['username']; $_SESSION['role'] = $user['role']; $_SESSION['key_code'] = $user['key_code']; $_SESSION['message'] = [ 'type' => 'success', 'text' => 'چوونەژوورەوە سەرکەوتوو بوو بەردەوام بە لە پشتڕاستکردنەوەی كلیلی چوونەژوورەوە' ]; header("Location: " . $_SERVER['PHP_SELF']); // Redirect to clear POST data exit; } else { $error_message = 'ناوی بەکارهێنەر یان وشەی نهێنی نادروسته‌'; } } else { $error_message = 'ناوی بەکارهێنەر یان وشەی نهێنی نادروسته‌'; } } elseif (isset($_POST['verify'])) { $key_code = $_POST['key_code']; if ($key_code === $_SESSION['key_code']) { $_SESSION['authenticated'] = true; $_SESSION['message'] = [ 'type' => 'success', 'text' => 'كلیلی چوونەژوورەوە پشتڕاستکرایەوە چاوه‌ڕوانبه‌ بۆ ئاڕاستەکردنەوە تۆ بۆ داشبۆرد' ]; $disable_keycode_input = true; // Lock the input } else { $error_message = "كلیلی چوونەژوورەوە نادروسته‌"; } } } // Clear session and reset variables when going back to login if (isset($_GET['action']) && $_GET['action'] === 'logout') { session_unset(); session_destroy(); header("Location: " . $_SERVER['PHP_SELF']); exit; } // Fetch data from WebsiteInfo table $sql = "SELECT logo, favicon FROM WebsiteInfo LIMIT 1"; // Query to fetch title, logo, and favicon $result = $conn->query($sql); if ($result && $result->num_rows > 0) { // Fetch the first row $row = $result->fetch_assoc(); $favicon = htmlspecialchars($row['favicon']); // Fetch and sanitize favicon $logo = htmlspecialchars($row['logo']); } else { die("No data found in the database."); // Stop execution if no data is found } ?> چوونه‌ژوره‌وه‌

بەخێر بێیتەوە

هەژمارەکەت داخڵ بکە بۆ ئەنجامدانی کارەکانت

Logo
Logo
required>