<?php
session_start();                  
$username=$_POST["cand_username"] ?? null;
$password=$_POST["cand_password"] ?? null;

$ip=$_SERVER['REMOTE_ADDR'] ?? null;
$xcentr = isset($_POST["xcentr"]) ? $_POST["xcentr"] : '';

include 'dbcon.php';
$password=md5($password);

$sql = mysqli_query($conn, "SELECT * FROM matcher_usermst WHERE nif_usr='$username' AND nif_pass='$password' AND act_vate='1'");
$login_check = mysqli_num_rows($sql);
if($login_check > 0){
    $_SESSION['username'] = $username;
    $_SESSION['password'] = $_POST["cand_password"] ?? '';
    $_SESSION['logged_in'] = true;
$row = mysqli_fetch_assoc($sql);
$xadmnchk=$row['dept_x'];
//echo "<meta http-equiv=Refresh content=1;url=https://novaivf.in/ews_grkhpr/ivflab/main_wlcm_ivflabn.php>";
echo "<meta http-equiv=Refresh content=1;url=pat_3.php>";
}else {
echo "Invalid login";
}
?>
