Notice: Undefined index: page in E:\PHP\test.php on line 14

Fiorenza ·
更新时间:2024-09-20
· 938 次阅读

治標不治本的就是將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;

您可能感兴趣的文章:PHP使用Session遇到的一个Permission denied Notice解决办法基于AppServ,XAMPP,WAMP配置php.ini去掉警告信息(NOTICE)的方法详解PHP提示Notice: Undefined variable的解决办法Notice: Trying to get property of non-object problem(PHP)解决办法PHP运行出现Notice : Use of undefined constant 的完美解决方案分享PHP新手NOTICE错误常见解决方法PHP函数之error_reporting(E_ALL ^ E_NOTICE)详细说明深入理解PHP原理之Session Gc的一个小概率Noticephp Notice: Undefined index 错误提示解决方法屏蔽PHP默认设置中的Notice警告的方法



notice undefined INDEX ON line PHP

需要 登录 后方可回复, 如果你还没有账号请 注册新账号