<?php
include("connect.php");
include("connectp.php");

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $ccampuscode = $_POST['ccampuscode'];
    /* $email = 'at.zeelsheth@gmail.com'; */
    
    // Perform a database query to check if the email exists
    $query = "SELECT COUNT(*) AS count FROM res_collegecampus_master WHERE ccampuscode = :ccampuscode";
    $stmt = $db7->prepare($query);
    $stmt->bindParam(':ccampuscode', $ccampuscode);
    $stmt->execute();
    $result = $stmt->fetch();
    $count = $result['count'];
    
    if ($count > 0) {
        echo 'exists';
    } else {
        echo 'unique';
    }
}
?>
