/
home
/
u551664935
/
domains
/
mechfactory.in
/
public_html
/
post_job
/
Upload File
HOME
<?php session_start(); include '../config.php'; // adjust path if needed $error = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $email = $_POST['email']; $pass = $_POST['password']; $stmt = $conn->prepare("SELECT id, password FROM users1 WHERE email = ?"); $stmt->bind_param("s", $email); $stmt->execute(); $res = $stmt->get_result(); $user = $res->fetch_assoc(); if ($user && password_verify($pass, $user['password'])) { $_SESSION['user_id'] = $user['id']; header("Location: post_job.php"); exit; } else { $error = "Invalid email or password."; } $stmt->close(); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Login - MechFactory</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Login to your MechFactory job worker account to post and manage job work listings."> <meta name="robots" content="index, follow"> <link rel="canonical" href="https://mechfactory.in/login.php"> <script src="https://cdn.tailwindcss.com"></script> </head> <body class="bg-gray-100 flex items-center justify-center min-h-screen"> <div class="bg-white shadow-lg rounded-lg w-full max-w-md p-8"> <h2 class="text-3xl font-bold text-blue-700 text-center mb-6">Job Worker Login</h2> <?php if (!empty($error)): ?> <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4"> <?= $error ?> </div> <?php endif; ?> <form method="POST" class="space-y-5"> <div> <label class="block text-sm font-medium text-gray-700">Email Address</label> <input type="email" name="email" required class="w-full px-4 py-2 border border-gray-300 rounded focus:ring-blue-500 focus:outline-none"> </div> <div> <label class="block text-sm font-medium text-gray-700">Password</label> <input type="password" name="password" required class="w-full px-4 py-2 border border-gray-300 rounded focus:ring-blue-500 focus:outline-none"> </div> <button type="submit" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded transition"> Login </button> </form> <p class="text-center text-sm text-gray-600 mt-6"> Don’t have an account? <a href="register.php" class="text-blue-600 hover:underline">Register here</a> </p> </div> </body> </html>