Notice: Undefined index: page in E:PHPtest.php on line 14_php技巧
程序员文章站
2022-06-02 20:36:37
...
治標不治本的就是將php.ini內的reporting部份修改,讓notice不顯示
error_reporting = E_ALL; display all errors, warnings and notices
改成
error_reporting = E_ERROR & ~E_NOTICE & ~E_WARNING
不然
isset($_GET["page"])做個if-else判斷!!
----修正後原始碼如下----
if(isset($_GET["page"]))$page=$_GET["page"];
else $page=1;
error_reporting = E_ALL; display all errors, warnings and notices
改成
error_reporting = E_ERROR & ~E_NOTICE & ~E_WARNING
不然
isset($_GET["page"])做個if-else判斷!!
----修正後原始碼如下----
if(isset($_GET["page"]))$page=$_GET["page"];
else $page=1;
推荐阅读
-
Notice: Undefined index: page in E:PHP est.php on line 14
-
Notice: Undefined index: page in E:PHP est.php on line 14
-
Notice: Undefined index: page in E:PHPtest.php on line 14_php技巧
-
Notice: Undefined index: page in E:PHPtest.php on line 14_php技巧
-
Notice: Undefined index: page in E:PHPtest.php on line 14的处理方法
-
Notice: Undefined index: page in E:PHPtest.php on line 14_PHP教程
-
Notice: Undefined index: page in E:PHPtest.php on line 14
-
Notice: Undefined index: page in E:PHPtest.php on line 14的处理方法