Home >Backend Development >PHP Tutorial >php-PHP if and else are both executed

php-PHP if and else are both executed

WBOY
WBOYOriginal
2016-09-19 08:54:151769browse

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();

<code>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"); </code>

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

?>

Reply content:

No error reported? You removed the session start in else

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn