首页 > 代码库 > Notice: Use of undefined constant out - assumed 'out' in D:wampwwwdaoruindex.php on line 4解决办法

Notice: Use of undefined constant out - assumed 'out' in D:wampwwwdaoruindex.php on line 4解决办法

 

这些是 PHP 的提示而非报错,PHP 本身不需要事先声明变量即可直接使用,但是对未声明变量会有提示。一般作为正式的网站会把提示关掉

的,甚至连错误信息也被关掉 解决办法:

1.在开头加上error_reporting(E_ALL & ~E_NOTICE); 这句话表示提示除去 E_NOTICE 之外的所有错误信息 因为post数组是个空的array,而代码中的这种方法适用于的是提交以后

2.如果觉得上述办法不彻底,还可以关闭php提示功能: 搜索php.ini:   error_reporting = E_ALL   改为:   error_reporting = E_ALL & ~E_NOTICE

Notice: Use of undefined constant out - assumed 'out' in D:wampwwwdaoruindex.php on line 4解决办法