CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  PHP

我从网上下载的PHP源站,怎么会出现如下错误呢?

楼主lieyingsky(Wxy)2004-12-01 09:49:32 在 Web 开发 / 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

相关问题

  • 下载了个.net论坛,运行后出现错误如下:
  • 网上下载的《Windows核心编程》的源代码编译产生如下错误,该怎么解决??
  • 出提示错误如下:
  • 下载文件有的可以正常下载打开,有的不可以,抛出如下错误信息,请问有什么办法解决吗?
  • php安装配置如下,但错误403,无法显示页面,请帮忙解决,急!!!
  • php升级到5.0后朋友的网站出现如下错误,这是怎么回事,如何改?谢谢
  • php查询无果,求救,拜托好心人帮我看看如下错误,多谢了,在线等~~~
  • 错误提示如下,什么意思?
  • vc错误如下,怎么回事?????
  • 如何解决如下的link错误?

关键词

  • php
  • 信息
  • html
  • datapath
  • notice
  • undefined constant
  • assumed
  • 错误
  • 提示
  • 出现

得分解答快速导航

  • 帖主:lieyingsky
  • erldy
  • xuzuning
  • fzjw
  • xuzuning
  • surfchen
  • surfchen

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo