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

php-PHP if and else are both executed

WBOY
Release: 2016-09-19 08:54:15
Original
1780 people have browsed it

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>
Copy after login

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

?>

Reply content:

No error reported? You removed the session start in else

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template