PHP:回显错误,未定义的空白页面

时间:2013-09-24 05:25:26

标签: php undefined

我正在尝试回显并打印出一些变量和一些数组。但是,每次我尝试所有出现的都是'Undefined'。我研究,但大多数与我的问题无关。不显示错误,而是显示仅包含单词“undefined”的空白页面。我设置了我的变量和所有,所以我知道它不是那样的。请帮帮我,有没有其他方式让我打印出来?

    <?PHP 

    session_start();

if (isset($_POST['name'])) {
        $_SESSION['username'] = $_POST['name'];
        $name = $_SESSION['username'];


        $namesql = "SELECT student_id FROM student_profile WHERE name='$name'";
        $nameQuer = mysql_query($namesql);
        $nameArr = mysql_fetch_assoc($nameQuer);
        $student_id = $nameArr['student_id'];
        //echo $student_id;
    }


    $store = array();
    if (isset($_POST['question_id'])) {
        foreach ($_POST['question_id'] as $key => $option) {
            //echo $key;
//            echo $option;

            $option1 = array_filter($option);
            print_r($option1);


            if (count($option1) > 1) {
                $option2 = implode("^", $option1);
                $store[] = $option2;
                // echo 'Option Mult Selected';
                //print($option2);
            } else {
                $value = $option1;

                $i = implode(null, $option1);
                // echo '<br />';
                // echo 'Option Single Selected';
                // echo $i;
                //print_r($value);
                //  echo'<br />';
                $store[] = $i;
            }
            //  echo '<br />';
        }
           print_r($store);
    }

    $t = new DateTime();
    $t->setTimestamp($time = time());
    $t->setTimeZone(new DateTimeZone("Asia/Singapore"));
    // print $t->format(DateTime::RFC850);
    $date = $t->format(DateTime::RFC850);



}
?>

0 个答案:

没有答案