duanmei4149 2014-04-02 08:40
浏览 54
已采纳

PHP错误:未定义的变量

can anyone told me what is my error. i know it only notice. All is work well but only show this notice. How to fix this? :

this is the code :

if (isset($_GET['match']) && $_GET['match'] == 'one') {
    $checked_match_one = ' checked="checked"';
    $page_string .= SEP.'match=one';
} else {
    $_GET['match'] = 'all';
    $checked_match_all = ' checked="checked"';
    $page_string .= SEP.'match=all';
}

the error it tell me this :

Notice: Undefined variable: page_string in C:\xampp\htdocs\msigilearnv2\admin\enrollment_attendance.php on line 110
Done writing the list into excel. Download
  • 写回答

5条回答 默认 最新

  • dragon19720808 2014-04-02 08:41
    关注

    Simple.Initialize $page_string before using it(before the if statement we can say) like

    $page_string = '';
    if (isset($_GET['match']) && $_GET['match'] == 'one') {
        $checked_match_one = ' checked="checked"';
        $page_string .= SEP.'match=one';
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 Stata链式中介效应代码修改
  • ¥15 latex投稿显示click download
  • ¥15 请问读取环境变量文件失败是什么原因?
  • ¥15 在若依框架下实现人脸识别
  • ¥15 网络科学导论,网络控制
  • ¥100 安卓tv程序连接SQLSERVER2008问题
  • ¥15 利用Sentinel-2和Landsat8做一个水库的长时序NDVI的对比,为什么Snetinel-2计算的结果最小值特别小,而Lansat8就很平均
  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错