我从网上下载的PHP源站,怎么会出现如下错误呢?
我只是想学习一下,错误如下:
Notice: Use of undefined constant datapath - assumed 'datapath' in e:\www\html\shop\config.php on line 11
Notice: Use of undefined constant userpath - assumed 'userpath' in e:\www\html\shop\config.php on line 12
Notice: Use of undefined constant shoppath - assumed 'shoppath' in e:\www\html\shop\config.php on line 13
Notice: Use of undefined constant linkphp - assumed 'linkphp' in e:\www\html\shop\config.php on line 14
Notice: Use of undefined constant header - assumed 'header' in e:\www\html\shop\config.php on line 15
Notice: Use of undefined constant img - assumed 'img' in e:\www\html\shop\config.php on line 17
Notice: Use of undefined constant home - assumed 'home' in e:\www\html\shop\config.php on line 19
Notice: Use of undefined constant name - assumed 'name' in e:\www\html\shop\config.php on line 20
Notice: Use of undefined constant pass - assumed 'pass' in e:\www\html\shop\config.php on line 21
Notice: Use of undefined constant email - assumed 'email' in e:\www\html\shop\config.php on line 22
Notice: Use of undefined constant title - assumed 'title' in e:\www\html\shop\config.php on line 23
Notice: Use of undefined constant ver - assumed 'ver' in e:\www\html\shop\config.php on line 24
Notice: Use of undefined constant homename - assumed 'homename' in e:\www\html\shop\config.php on line 25
Notice: Use of undefined constant ubb - assumed 'ubb' in e:\www\html\shop\config.php on line 26
Notice: Use of undefined constant html - assumed 'html' in e:\www\html\shop\config.php on line 27
Notice: Use of undefined constant page - assumed 'page' in e:\www\html\shop\config.php on line 28
Notice: Use of undefined constant ltd - assumed 'ltd' in e:\www\html\shop\config.php on line 34
Notice: Use of undefined constant tel - assumed 'tel' in e:\www\html\shop\config.php on line 35
Notice: Use of undefined constant fax - assumed 'fax' in e:\www\html\shop\config.php on line 36
Notice: Use of undefined constant bgcolor1 - assumed 'bgcolor1' in e:\www\html\shop\config.php on line 38
Notice: Use of undefined constant bgcolor2 - assumed 'bgcolor2' in e:\www\html\shop\config.php on line 39
Notice: Use of undefined constant home - assumed 'home' in e:\www\html\shop\config.php on line 40
Notice: Use of undefined constant password - assumed 'password' in e:\www\html\shop\config.php on line 41
Notice: Undefined index: password in e:\www\html\shop\config.php on line 41
Notice: Use of undefined constant email - assumed 'email' in e:\www\html\shop\config.php on line 42
问题点数:80、回复次数:14Top
1 楼erldy(我还是我)回复于 2004-12-01 10:05:22 得分 10
这不算是错误,是提示。应该是你的PHP的版本需要你先声明变量然后才使用,不过也应该养成变量先声明后使用的编程习惯。好像可以设置php不显示这些提示的。Top
2 楼lieyingsky(Wxy)回复于 2004-12-01 10:14:42 得分 0
还有,我虽然装上MySQL,但是不是必须要将MySQL与PHP网页一起放在www文件夹下呢?Top
3 楼xuzuning(唠叨)回复于 2004-12-01 10:18:38 得分 10
不想出现这些警告信息,可以
php.ini中error_reporting = E_ALL & ~E_NOTICE
或在程序开头加上:
error_reporting(E_ALL & ~E_NOTICE);
但这并不能解决根本问题,根据你的情况。需要在php.ini中设置
register_globals=on
Top
4 楼lieyingsky(Wxy)回复于 2004-12-01 10:38:16 得分 0
我是将php.ini中error_reporting = E_ALL & ~E_NOTICE改为php.ini中error_reporting = E_ALL 了,但不管事呀
register_globals=on又是做什么的呢?Top
5 楼lieyingsky(Wxy)回复于 2004-12-01 10:41:15 得分 0
register_globals=on已经设为on了,但为什么还会出现如上那么多的提示信息呢Top
6 楼lieyingsky(Wxy)回复于 2004-12-01 10:41:59 得分 0
register_globals=on已经设为on了,但为什么还会出现如上那么多的提示信息呢Top
7 楼fzjw(冰凌尘埃)回复于 2004-12-01 11:05:58 得分 5
设置完成后重启WEB服务了没有??Top
8 楼lieyingsky(Wxy)回复于 2004-12-01 11:28:05 得分 0
大家给分析一下这些错误的真正原因是什么,怎么来解决?Top
9 楼xuzuning(唠叨)回复于 2004-12-01 11:30:34 得分 5
原因是使用了未经定义的变量或下标
Top
10 楼surfchen(冲浪)回复于 2004-12-01 11:33:36 得分 30
[datapath]之类的改成['datapath']Top
11 楼lieyingsky(Wxy)回复于 2004-12-01 11:38:17 得分 0
如何解决,大家都遇到过这些问题吗?Top
12 楼lieyingsky(Wxy)回复于 2004-12-01 11:48:23 得分 0
将[datapath]之类的改成['datapath']确实可以取消这些提示,但这是什么原因呢?就是未定义吗?
怎么加入'就没事了呢
还有:
Notice: Undefined index: password in e:\www\html\shop\config.php on line 41
这又是什么提示呢?如何改?
Top
13 楼surfchen(冲浪)回复于 2004-12-01 12:01:28 得分 20
因为[datapath]没有引号,PHP先以常量来处理datapath,而后发现它并不是一个常量,就以一个字符串来处理~~~虽然能正确处理,但是PHP还是会抛出一个NOTICE警告你~~~
出现Notice: Undefined index: password in e:\www\html\shop\config.php on line 41
是因为你的数组没有password这个索引....增加了就是了Top
14 楼lieyingsky(Wxy)回复于 2004-12-01 13:25:21 得分 0
谢了Top




