Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 修复了项目中所有未定义的常量_Php_Constants - Fatal编程技术网

Php 修复了项目中所有未定义的常量

Php 修复了项目中所有未定义的常量,php,constants,Php,Constants,我必须和其他人一起做这个项目。 在xamp和wamp中,一切都是正确的,但在主机中运行在线演示时,所有页面都包含“注意:使用未定义常量”错误。 我知道“常量”错误删除,但错误行太多,我无法找到它们并逐行删除。我如何解决这个问题?或强制主机行为,如xamp Notice: Use of undefined constant submit - assumed 'submit' Notice: Use of undefined constant del Notice: Undefined va

我必须和其他人一起做这个项目。 在xamp和wamp中,一切都是正确的,但在主机中运行在线演示时,所有页面都包含“注意:使用未定义常量”错误。 我知道“常量”错误删除,但错误行太多,我无法找到它们并逐行删除。我如何解决这个问题?或强制主机行为,如xamp

 Notice: Use of undefined constant submit - assumed 'submit'
 Notice: Use of undefined constant del 
 Notice: Undefined variable: flag

有太多的错误,我无法修复所有问题。

由于您没有提供代码,我猜您没有引用数组键-

你用过

$_POST[submit] 
而不是

$_POST['submit'] (or $_POST["submit"])

如果每个页面中都包含任何类型的配置文件,请尝试在开始时设置如下内容:

error_reporting(E_ALL ^ E_NOTICE);
error_reporting = E_ALL ^ E_NOTICE
或者,您可以找到php.ini文件,找到定义默认错误处理行为的行,并将其设置为类似以下内容:

error_reporting(E_ALL ^ E_NOTICE);
error_reporting = E_ALL ^ E_NOTICE

这看起来像是没有
$
xampp、wamp和其他一些PHP垃圾软件的变量引用的结果,默认情况下,错误报告已关闭。我建议修复错误,而不是“隐藏”它们。不幸的是,共享主机和我没有能力更改文件这里是我如何解释问题的,我知道,但错误的数量非常高