未定义的索引键,无法修改标头信息

时间:2018-10-09 07:51:30

标签: php mysql warnings

我已经在php中发布了在线考试。当用户开始测验时,在最后一个问题之后单击“提交”,则在该提交过程中发生了错误。但是,只有xampp中的mo localhost在提交后没有错误。 这是update.php

<?php
include_once 'dbConnection.php';
session_start();
$email=$_SESSION['email'];
//delete feedback
if(isset($_SESSION['key'])){
    if(@$_GET['fdid'] && $_SESSION['key']=='najma7785068889') {
        $id=@$_GET['fdid'];
        $result = mysqli_query($con,"DELETE FROM feedback WHERE id='$id' ") or die('Error');
        header("location:dash.php?q=3");
    }
}
//restart quiz
if(@$_GET['q']== 'quizre' && @$_GET['step']== 25 ) {
    $eid=@$_GET['eid'];
    $n=@$_GET['n'];
    $t=@$_GET['t'];
    $q=mysqli_query($con,"SELECT score FROM history WHERE eid='$eid' AND email='$email'" ) or die('Error156');
    while($row=mysqli_fetch_array($q) ){
        $s=$row['score'];
    }
    $q=mysqli_query($con,"DELETE FROM `history` WHERE eid='$eid' AND email='$email' " )or die('Error184');
    $q=mysqli_query($con,"SELECT * FROM rank WHERE email='$email'" )or die('Error161');
    while($row=mysqli_fetch_array($q) ){
        $sun=$row['score'];
    }
    $sun=$sun-$s;
    $q=mysqli_query($con,"UPDATE `rank` SET `score`=$sun ,time=NOW() WHERE email= '$email'")or die('Error174');
    header("location:account.php?q=quiz&step=2&eid=$eid&n=1&t=$t");
}
?>

以下是错误的屏幕截图:

Undefined Index Key

Couldn't fetch mysqli

或访问网站

http://adolescent-development.000webhostapp.com/

0 个答案:

没有答案