未定义的索引:动作

时间:2017-05-11 06:42:03

标签: php

突出显示的行是第24行

注意:未定义的索引:第24行的C:\ xampp \ htdocs \ authors.php中的操作

  **if($_GET['action'] == "list") {**
        $current = "members";
        $list = "members";
    }
    else if($_GET["list"] == "authors") $current = "authors";
    else $current = "members";

1 个答案:

答案 0 :(得分:0)

首先检查是否已设置$_GET['action']

if(isset($_GET['action'])) {

    if($_GET['action'] == "list") {
        $current = "members";
        $list = "members";
    } else if($_GET["list"] == "authors") {
        $current = "authors";
    } else {
        $current = "members";
    }

}