format('Y-m-d H:i:s'); $date = date('Y/m/d H:i:s');
//Check if exist
if(clearParam(strtolower(" " . $un . $p1))){
$form_t = file_get_contents("themes/jaxtheme/jax_log.html");
$fglobal = file_get_contents("themes/jaxtheme/globalt.html");
$fglobal = str_replace("%mytitle%","LogIn",$fglobal);
$fglobal = str_replace("%h%","",$fglobal);
$fglobal = str_replace("%s%","",$fglobal);
$fglobal = str_replace("%l%","class='active'",$fglobal);
$fglobal = str_replace("%r%","",$fglobal);
$fglobal = str_replace("%content%","Bad Request. We have noted your IP." . $form_t,$fglobal);
echo $fglobal;
}
else{ //log in
$login_st = logindb($un, $p1);
if (count($login_st)>0){
$_SESSION['un'] = $login_st['1']['UN'];
$_SESSION['fn'] = $login_st['1']['FN'];
$_SESSION['ln'] = $login_st['1']['LN'];
$_SESSION['others'] = $login_st['1']['OTHERS'];
$_SESSION['id'] = $login_st['1']['ID'];
$_SESSION['regid'] = $login_st['1']['REGID'];
$_SESSION['eid'] = $login_st['1']['EXAMID'];
header('Location: jax_m.php');
exit;
}
else{
$form_t = file_get_contents("themes/jaxtheme/jax_log.html");
$fglobal = file_get_contents("themes/jaxtheme/globalt.html");
$fglobal = str_replace("%mytitle%","LogIn",$fglobal);
$fglobal = str_replace("%h%","",$fglobal);
$fglobal = str_replace("%s%","",$fglobal);
$fglobal = str_replace("%l%","class='active'",$fglobal);
$fglobal = str_replace("%r%","",$fglobal);
$fglobal = str_replace("%content%","Invalid login." . $form_t,$fglobal);
echo $fglobal;
}
}
}
else{ //Invalid access
$form_t = file_get_contents("themes/jaxtheme/jax_log.html");
$fglobal = file_get_contents("themes/jaxtheme/globalt.html");
$fglobal = str_replace("%mytitle%","LogIn",$fglobal);
$fglobal = str_replace("%h%","",$fglobal);
$fglobal = str_replace("%s%","",$fglobal);
$fglobal = str_replace("%l%","class='active'",$fglobal);
$fglobal = str_replace("%r%","",$fglobal);
$fglobal = str_replace("%content%", $form_t,$fglobal);
echo $fglobal;
}
?>