当前位置:Gxlcms > PHP教程 > php-PHPif和else都被执行问题

php-PHPif和else都被执行问题

时间:2021-07-01 10:21:17 帮助过:78人阅读

php

require_once 'jiaowu.php';

$jwid=$_POST['jwid'];
$jwpw=$_POST['jwpw'];
$jwsc=$_POST['jwsc'];

$isLogin = getLogin($jwid,$jwpw,$jwsc);

if ($isLogin=="yes") {
session_start();
$xuenia = getXueNian($jwid);
$scoreArry = array();

for ($i=0; $i < count($xuenia); $i++) {    //每个学年两个学期    $scoreArry[] = get_td_array(getGrade($jwid,$xuenia[$i],"1"),"1");    $scoreArry[] = get_td_array(getGrade($jwid,$xuenia[$i],"2"),"2");}// $s=getGrade($jwid,$xuenia[$i],"2");// $_SESSION['name']=getName($s);// $_SESSION['college']=getCollege($s);$_SESSION['course']=getcoursecontent(getcourse($jwid));$_SESSION['score']=$scoreArry;Header("Location:show.php"); 

}else{
session_start();
$_SESSION['error']="errorLogin";
header("Location:index.php");
}

?>

回复内容:

没报错吗?你把else里的session start去了

人气教程排行