Solution to Notice: Use of undefined constant when running PHP

WBOY
Release: 2016-07-25 09:10:15
Original
2107 people have browsed it
When modifying the program, it prompts Notice: Use of undefined constant. It can be solved by the following method. It is best to use error_reporting(0); without changing the configuration.

When modifying the program, it prompts Notice: Use of undefined constant. It can be solved by the following method. It is best to use error_reporting(0); no configuration changes are required. Notice: Use of undefined constant ALL_PS - assumed 'ALL_PS' in E:Servervhostswww.lvtao.netglobal.php on line 50 Notice: Undefined index: EaseTemplateVer in E:Servervhostswww.lvtao.netlibstemplate.core.php on line 51 Notice: Use of undefined constant uid - assumed 'uid' in E:Servervhostswww.lvtao.netglobal.php on line 54 Notice: Undefined index: uid in E:Servervhostswww.lvtao.netglobal.php on line 54 Notice: Use of undefined constant cuid - assumed 'cuid' in E:Servervhostswww.lvtao.netglobal.php on line 55 Notice: Undefined index: cuid in E:Servervhostswww.lvtao.netglobal.php on line 55 Notice: Use of undefined constant shell - assumed 'shell' in E:Servervhostswww.lvtao.netglobal.php on line 56 Notice: Undefined index: shell in E:Servervhostswww.lvtao.netglobal.php on line 56 Notice: Use of undefined constant cshell - assumed 'cshell' in E:Servervhostswww.lvtao.netglobal.php on line 57 Notice: Undefined index: cshell in E:Servervhostswww.lvtao.netglobal.php on line 57 Notice: Use of undefined constant username - assumed 'username' in E:Servervhostswww.lvtao.netglobal.php on line 58 Notice: Undefined index: username in E:Servervhostswww.lvtao.netglobal.php on line 58 Notice: Use of undefined constant cusername - assumed 'cusername' in E:Servervhostswww.lvtao.netglobal.php on line 59 Notice: Undefined index: cusername in E:Servervhostswww.lvtao.netglobal.php on line 59 Notice: Use of undefined constant id - assumed 'id' in E:Servervhostswww.lvtao.netcompanyjob.php on line 10 Notice: Use of undefined constant id - assumed 'id' in E:Servervhostswww.lvtao.netcompanyjob.php on line 14 Notice: Use of undefined constant content - assumed 'content' in E:Servervhostswww.lvtao.netcompanyjob.php on line 16 Notice: Use of undefined constant content - assumed 'content' in E:Servervhostswww.lvtao.netcompanyjob.php on line 16 Notice: Use of undefined constant description - assumed 'description' in E:Servervhostswww.lvtao.netcompanyjob.php on line 17 Notice: Use of undefined constant description - assumed 'description' in E:Servervhostswww.lvtao.netcompanyjob.php on line 17 Notice: Use of undefined constant provinceid - assumed 'provinceid' in E:Servervhostswww.lvtao.netcompanyjob.php on line 18 Notice: Use of undefined constant cityid - assumed 'cityid' in E:Servervhostswww.lvtao.netcompanyjob.php on line 19 Notice: Use of undefined constant hy - assumed 'hy' in E:Servervhostswww.lvtao.netcompanyjob.php on line 20 Notice: Undefined variable: content in E:Servervhostswww.lvtao.netlibstemplate.core.php on line 557

When entering the website, a large number of prompts similar to the following will appear, but they can be displayed and run normally. Notice: Use of undefined constant ctbTitle - assumed 'ctbTitle' in d:ctb1.5ctbincludeconfig.php on line 23...

B answer: These are PHP prompts rather than errors. PHP itself can be used directly without declaring variables in advance, but there will be prompts for undeclared variables. Generally, as an official website, prompts will be turned off, and even error messages will be turned off

How to turn off PHP prompt

Search php.ini: error_reporting = E_ALL Change to: error_reporting = E_ALL & ~E_NOTICE There is another solution that is not a solution

Add to the header of each file error_reporting(0); Although it is not easy to do, it can solve the problem. This is easier to use.



source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!