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 宇视监控服务器无法登录
  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据
  • ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)