HEX
Server: nginx/1.24.0
System: Linux webserver-one 6.8.0-101-generic #101-Ubuntu SMP PREEMPT_DYNAMIC Mon Feb 9 10:15:05 UTC 2026 x86_64
User: www-data (33)
PHP: 8.4.18
Disabled: NONE
Upload Files
File: /srv/www/rectt-csmcri.res.in/public_html/login.php
<?php
session_start();
?>

<!DOCTYPE html>
<html lang="en">

<head>
    <title>Login</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>

<body class="bg-light d-flex justify-content-center align-items-center min-vh-100 py-3">
    <div class="container px-3">
        <div class="row justify-content-center">
            <div class="col-12 col-sm-10 col-md-7 col-lg-5 col-xl-4">
                <div class="bg-white p-4 rounded shadow-sm">
                    <h3 class="text-center mb-4">Login</h3>

                    <?php
                    if (isset($_SESSION['registration_success'])) {
                        echo "<div class='alert alert-success'>Successfully Registered, please login</div>";
                        unset($_SESSION['registration_success']);
                    }
                    if (isset($_SESSION['registered'])) {
                        header("location: primary.php");
                        exit();
                    }
                    ?>

                    <form method="post" action="checklogin.php">
                        <div class="mb-3">
                            <input name="myemail" id="myemail" type="email" class="form-control" placeholder="Email" required>
                        </div>
                        <div class="mb-3">
                            <input name="mypassword" id="mypassword" type="password" class="form-control" placeholder="Password" required>
                        </div>

                        <?php
                        include_once 'sites/config/config.php';
                        $result = $conn->query("SELECT id, title FROM Advertisement WHERE status = 'Published' AND last_date_to_apply >= CURDATE()");
                        ?>
                        <div class="mb-3">
                            <select name="ad_id" id="ad_id" class="form-select" required>
                                <option value="">Select Advertisement</option>
                                <?php while ($ad = $result->fetch_assoc()): ?>
                                    <option value="<?= $ad['id'] ?>"><?= htmlspecialchars($ad['title']) ?></option>
                                <?php endwhile; ?>
                            </select>
                        </div>
                        <?php $conn->close(); ?>

                        <div class="d-grid mb-3">
                            <button name="Submit" id="submit" class="btn btn-primary" type="submit">Sign in</button>
                        </div>

                        <div id="message"></div>

                        <p class="text-center mb-1">
                            Don't have an account? <a href="register.php">Register</a>
                        </p>
                        <small class="d-block text-muted text-center">
                            Note: For each Advertisement you are applying for, you will have to create an account with that Advertisement.
                        </small>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <script src="https://code.jquery.com/jquery.js"></script>
    <script src="js/bootstrap.js"></script>
    <script src="js/login.js"></script>
</body>

</html>