<?php
// Connect to the database
include 'connect.php';

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $stbfno = $_POST['stbfno'];

    $sql = "SELECT * FROM student_information WHERE stbfno = ?";
    $stmt = $conn->prepare($sql);
    $stmt->bind_param("s", $stbfno);
    $stmt->execute();
    $stmt->store_result();

    if ($stmt->num_rows > 0) {
        echo 'exists';
    } else {
        echo 'available';
    }

    $stmt->close();
}

$conn->close();
?>