PHP运行出现Notice : Use of undefined constant 的完美解决方案分享


Posted in PHP onMarch 05, 2012

Notice: Use of undefined constant ALL_PS - assumed 'ALL_PS' in E:\Server\vhosts\www.lvtao.net\global.php on line 50

Notice: Undefined index: EaseTemplateVer in E:\Server\vhosts\www.lvtao.net\libs\template.core.php on line 51

Notice: Use of undefined constant uid - assumed 'uid' in E:\Server\vhosts\www.lvtao.net\global.php on line 54

Notice: Undefined index: uid in E:\Server\vhosts\www.lvtao.net\global.php on line 54

Notice: Use of undefined constant cuid - assumed 'cuid' in E:\Server\vhosts\www.lvtao.net\global.php on line 55

Notice: Undefined index: cuid in E:\Server\vhosts\www.lvtao.net\global.php on line 55

Notice: Use of undefined constant shell - assumed 'shell' in E:\Server\vhosts\www.lvtao.net\global.php on line 56

Notice: Undefined index: shell in E:\Server\vhosts\www.lvtao.net\global.php on line 56

Notice: Use of undefined constant cshell - assumed 'cshell' in E:\Server\vhosts\www.lvtao.net\global.php on line 57

Notice: Undefined index: cshell in E:\Server\vhosts\www.lvtao.net\global.php on line 57

Notice: Use of undefined constant username - assumed 'username' in E:\Server\vhosts\www.lvtao.net\global.php on line 58

Notice: Undefined index: username in E:\Server\vhosts\www.lvtao.net\global.php on line 58

Notice: Use of undefined constant cusername - assumed 'cusername' in E:\Server\vhosts\www.lvtao.net\global.php on line 59

Notice: Undefined index: cusername in E:\Server\vhosts\www.lvtao.net\global.php on line 59

Notice: Use of undefined constant id - assumed 'id' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 10

Notice: Use of undefined constant id - assumed 'id' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 14

Notice: Use of undefined constant content - assumed 'content' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 16

Notice: Use of undefined constant content - assumed 'content' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 16

Notice: Use of undefined constant description - assumed 'description' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 17

Notice: Use of undefined constant description - assumed 'description' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 17

Notice: Use of undefined constant provinceid - assumed 'provinceid' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 18

Notice: Use of undefined constant cityid - assumed 'cityid' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 19

Notice: Use of undefined constant hy - assumed 'hy' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 20

Notice: Undefined variable: content in E:\Server\vhosts\www.lvtao.net\libs\template.core.php on line 557

进入网站会出现大量类似下面的提示,但是可以正常显示和运行

Notice: Use of undefined constant ctbTitle - assumed 'ctbTitle' in d:\ctb1.5\ctb\include\config.php on line 23...

b答案:这些是 PHP 的提示而非报错,PHP 本身不需要事先声明变量即可直接使用,但是对未声明变量会有提示。一般作为正式的网站会把提示关掉的,甚至连错误信息也被关掉

关闭 PHP 提示的方法

搜索php.ini:

error_reporting = E_ALL

改为:

error_reporting = E_ALL & ~E_NOTICE

还有个不是办法的办法就是

在每个文件头上加

error_reporting(0); 虽然不好弄但是可以解决问题!!!!!!这个比较好用

PHP 相关文章推荐
php下连接ftp实现文件的上传、下载、删除文件实例代码
Jun 03 PHP
php数据结构与算法(PHP描述) 查找与二分法查找
Jun 21 PHP
探讨fckeditor在Php中的配置详解
Jun 08 PHP
php使用异或实现的加密解密实例
Sep 04 PHP
php实现字符串首字母转换成大写的方法
Mar 17 PHP
PHP中把数据库查询结果输出为json格式简单实例
Apr 09 PHP
PHP中substr函数字符串截取用法分析
Jan 07 PHP
Zend Framework教程之Zend_Registry对象用法分析
Mar 22 PHP
Smarty模板引擎缓存机制详解
May 23 PHP
ThinkPHP打水印及设置水印位置的方法
Oct 14 PHP
php简单实现单态设计模式的方法分析
Jul 28 PHP
PHP echo()函数讲解
Feb 15 PHP
php在服务器执行exec命令失败的解决方法
Mar 03 #PHP
Php Ctemplate引擎开发相关内容
Mar 03 #PHP
PHP代码网站如何防范SQL注入漏洞攻击建议分享
Mar 01 #PHP
PHP和JAVA中的重载(overload)和覆盖(override) 介绍
Mar 01 #PHP
JS中encodeURIComponent函数用php解码的代码
Mar 01 #PHP
PHP设计模式之装饰者模式
Feb 29 #PHP
php preg_filter执行一个正则表达式搜索和替换
Feb 27 #PHP
You might like
php中字符集转换iconv函数使用总结
2014/10/11 PHP
Yii2中YiiBase自动加载类、引用文件方法分析(autoload)
2016/07/25 PHP
php使用高斯算法实现图片的模糊处理功能示例
2016/11/11 PHP
[原创]php实现 data url的图片生成与保存
2016/12/04 PHP
php+ajax 文件上传代码实例
2019/03/18 PHP
csdn 论坛技术区平均给分功能
2009/11/07 Javascript
不要在cookie中使用特殊字符的原因分析
2010/07/13 Javascript
仅IE9/10同时支持script元素的onload和onreadystatechange事件分析
2011/04/27 Javascript
js获取微信版本号的方法
2015/05/12 Javascript
js仿苹果iwatch外观的计时器代码分享
2015/08/26 Javascript
全面了解函数声明与函数表达式、变量提升
2016/08/09 Javascript
微信小程序 解决swiper不显示图片的方法
2017/01/04 Javascript
详解使用Vue.Js结合Jquery Ajax加载数据的两种方式
2017/01/10 Javascript
mac下的nodejs环境安装的步骤
2017/05/24 NodeJs
一些手写JavaScript常用的函数汇总
2019/04/16 Javascript
js中let能否完全替代IIFE
2019/06/15 Javascript
Vue组件实现触底判断
2019/06/26 Javascript
vue动态配置模板 'component is'代码
2019/07/04 Javascript
OpenLayer3自定义测量控件MeasureTool
2020/09/28 Javascript
[48:02]Ti4循环赛第三日 VG vs Liquid和NEWBEE vs DK
2014/07/12 DOTA
python爬虫爬取某站上海租房图片
2018/02/04 Python
python之验证码生成(gvcode与captcha)
2019/01/02 Python
python将excel转换为csv的代码方法总结
2019/07/03 Python
Python3.7在anaconda里面使用IDLE编译器的步骤详解
2020/04/29 Python
Django nginx配置实现过程详解
2020/09/10 Python
CSS3绘制超炫的上下起伏波动进度加载动画
2016/04/21 HTML / CSS
CSS3.0实现霓虹灯按钮动画特效的示例代码
2021/01/12 HTML / CSS
Zadig&Voltaire官网:法国时装品牌
2018/01/05 全球购物
COS美国官网:知名服装品牌
2019/04/08 全球购物
自我鉴定怎么写
2013/12/05 职场文书
日语求职信范文
2013/12/17 职场文书
四好少年事迹材料
2014/01/12 职场文书
多媒体专业自我鉴定
2014/02/28 职场文书
财务会计岗位职责
2015/02/03 职场文书
2015年度招聘工作总结
2015/05/28 职场文书
Python+Tkinter打造签名设计工具
2022/04/01 Python