2017-05-11 122 views
-2

的加亮的行是行24未定義指數:動作

說明:未定義指數:動作在C:\ XAMPP \ htdocs中\上線authors.php 24

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

回答

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"; 
    } 

}