為什么會提示這個呢?
otice: Undefined index: act in I:\phpstudy\imcco\fileManager\index.php on line 8
Notice: Undefined index: filename in I:\phpstudy\imcco\fileManager\index.php on line 9
為什么會提示這個呢?
otice: Undefined index: act in I:\phpstudy\imcco\fileManager\index.php on line 8
Notice: Undefined index: filename in I:\phpstudy\imcco\fileManager\index.php on line 9
2014-08-18
舉報
2014-08-19
Notice不是錯誤,這和你PHP的錯誤級別設(shè)置的有關(guān)!你可以配置PHP配置文件中的error_reporting選項(xiàng),之后設(shè)置E_ALL&~E_NOTICE,重啟服務(wù)器就好了!^_^...
2014-10-08
第一次打開頁面因?yàn)槟隳銢]有點(diǎn)act 所以就會出現(xiàn)未定義? 當(dāng)你點(diǎn)了以后就沒事;
2014-09-11
解決了,在前面加個@符號就不報錯了!
2014-09-04
最好把代碼貼出來, 不然怎么知道你哪里有問題??
猜測,你這里肯定是直接使用了某個變量, 一般不想讓其有提示 除了上面的方法,讓PHP引擎幫我們隱藏,還可以 自己規(guī)范, 比較常用的方法是 用isset()函數(shù)判斷,如果存在這個變量才使用,不存在的話后面使用,會出現(xiàn)你上面的Notice錯誤, 所以我們可以給個初始的默認(rèn)值!