window.location.href = '/?student_login_succ_before'; "; exit(); }else{ echo ""; exit(); } } //require_once $_SERVER['DOCUMENT_ROOT'].'/wp-config.php'; wp_head(); function backButtonHTML() { return '按此返回上一頁'; } ?>
if($_POST){
$school_no = isset($_POST['a']) ? $_POST['a'] : '';
$school_no = trim(strtolower($school_no));
$pwd = isset($_POST['b']) ? $_POST['b'] : '';
if( !is_mgr_student_school_no($school_no)
and !is_medical_student_school_no($school_no)
and !is_industrial_student_school_no($school_no)
and !is_generativeAI_student_school_no($school_no)
and !is_business_student_school_no($school_no)
and !is_tech_student_school_no($school_no)
){
echo '您輸入了不正確的學號格式:';
echo ($school_no);
echo "
".backButtonHTML();
exit;
}
if($school_no and $pwd){
$login_result = MgrStudents::login_result(strtolower($school_no),$pwd);
if(false and $_SERVER['REMOTE_ADDR']=='118.163.102.67'){
echo get_logined_success_redirect_url($school_no);
var_dump($login_result);
print_r($_SESSION);exit;
}
if(!$login_result){
die('您輸入的學號或密碼有誤 --> '.$school_no."
".backButtonHTML());
}elseif($login_result->is_deleted==1){
die('Your account is expired. --> '.$school_no);
}else{
$_SESSION['aia_student_school_no'] = $school_no;
// header('location: '.get_logined_success_redirect_url($school_no).'?student_login_succ');
echo "";
exit;
}
}
} ?>