Home > Backend Development > PHP Tutorial > The perfect solution to PHP error Notice: Use of undefined constant

The perfect solution to PHP error Notice: Use of undefined constant

WBOY
Release: 2016-08-08 09:24:59
Original
1963 people have browsed it

Reprinted from: http://www.phperz.com/article/14/1212/7309.html

This article explains to you the perfect solution to the PHP error Notice: Use of undefined constant, this non-fatal error in PHP The reminder appears very frequently in versions above pph5.3, mainly because of the wrong level configuration problem in php.ini. Interested students can refer to it.

This article explains PHP to everyone. Error Notice: The perfect solution to Use of undefined constant. This php non-fatal error reminder appears very frequently in pph5.3 and above versions, mainly because of the error level configuration problem in php.ini. Interested For your reference.

Problem description;

Today I modified the company’s website, prompting Notice: Use of undefined constant. It was solved by the following method. It is best to use error_reporting(0); no need to change the configuration
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 it can be displayed and run normally
Notice: Use of undefined constant ctbTitle - assumed 'ctbTitle' in d:ctb1.5ctbincludeconfig.php on line 23...
bAnswer: These are PHP prompts rather than errors. PHP itself can be used directly without declaring variables in advance, but there will be errors for undeclared variables. hint. Generally, as an official website, prompts will be turned off, and even error messages will be turned off.
How to turn off PHP prompts
Search php.ini:
error_reporting = E_ALL
Change to:
error_reporting = E_ALL & ~E_NOTICE
Also The only solution is to add
error_reporting(0); to the header of each file. Although it is not easy to do, it can solve the problem! ! ! ! ! ! This one is easier to use


The above introduces the perfect solution to the PHP error Notice: Use of undefined constant, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
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