Notice: Undefined variable: _SESSION in Z:\Apache24\htdocs\doit.php on line 10

<?php 
        
        $conn=mysqli_connect('localhost', 'root', 'mysql2016', 'xuanke');
       
        mysqli_query($conn,'set names utf8');


   $name=$_GET['name'];
   $typename=$_GET['typename'];
   $score=$_GET['score'];
   $username=$_SESSION['hymc'];
   $stuname=$_SESSION['huiyuan'];
  //if(mysql_query("select * from xuanke where username='$_SESSION['hymc']' and name='$name'") or die("操作失败!"))
 
$sqlstr="SELECT name FROM xuanke WHERE username='$username' and name ='$name' ";
$result=mysqli_query($conn,$sqlstr) or die();
$row=mysqli_fetch_array($result); 
if($row)
{
     echo"<script>alert('您你已经选了此课程!');history.go(-1)</script>";
}
else
{
   if(mysqli_query($conn,"insert into xuanke(username,stuname,name,typename,score)values('$username','$stuname','$name','$typename','$score')"))
{
  
}
else
{

}
 }

?>

新手一枚,求帮助,出现该问题该怎么办?


文章来源: Notice: Undefined variable: _SESSION in Z:\Apache24\htdocs\doit.php on line 10

人吐槽 人点赞

猜你喜欢

发表评论

用户名: 密码:
验证码: 匿名发表

你可以使用这些语言

查看评论:Notice: Undefined variable: _SESSION in Z:\Apache24\htdocs\doit.php on line 10