JTBC(CMS)

开源与免费的跨平台网站内容管理系统解决方案

腾讯交流群: 2254994
技术支持群: 27032719
首页 » 在线论坛 » PHP版本 
帖子内容
1 楼
guwx
注册会员
积分 10
注册 2008-01-23
     
[求助]配好PHP环境出现的问题!
Notice: Undefined index: site_skin in E:wwwroot(PHP)JTBC_CMS_1.0.0.5commonincfilescommon.inc.php on line 920

Notice: Undefined index: site_language in E:wwwroot(PHP)JTBC_CMS_1.0.0.5commonincfilescommon.inc.php on line 921

Notice: Undefined index: site_template in E:wwwroot(PHP)JTBC_CMS_1.0.0.5commonincfilescommon.inc.php on line 922

Notice: Undefined index: jtb_cms_config in E:wwwroot(PHP)JTBC_CMS_1.0.0.5commonincfilesfunction.inc.php on line 524

Notice: Undefined index: jtb_cms_config in E:wwwroot(PHP)JTBC_CMS_1.0.0.5commonincfilesfunction.inc.php on line 524

Notice: Undefined index: QUERY_STRING in E:wwwroot(PHP)JTBC_CMS_1.0.0.5commonincfilescommon.inc.php on line 946

Notice: Undefined index: jtb_cms_config in E:wwwroot(PHP)JTBC_CMS_1.0.0.5commonincfilesfunction.inc.php on line 524

Notice: Undefined index: jtb_cms_common_template_tpl_config_tpl_default in E:wwwroot(PHP)JTBC_CMS_1.0.0.5commonincfilesfunction.inc.php on line 821
2008-01-23 17:45:44
2 楼
高山
注册会员
积分 586
注册 2007-03-22
     
我也出现同样错误,什么原因?
2009-08-22 21:02:21
3 楼
Dicky
注册会员
积分 140
注册 2007-11-23
     
同问!!!!急!!!!!!
2009-11-14 18:08:42
4 楼
husw
银牌会员
积分 256
注册 2008-05-06
     
回复: [求助]配好PHP环境出现的问题!
PHP Notice: Undefined index: ... 问题的解决方案

首先,这个不是错误,是warning。所以如果服务器不能改,每个变量使用前应当先定义。


方法1:服务器配置修改
修改php.ini配置文件,error_reporting = E_ALL & ~E_NOTICE


方法2:对变量进行初始化,规范书写(比较烦琐,因为有大量的变量)。但还没有找到好定义方法,望大家指教

方法3:每个文件头部加上:error_reporting(0); 如果不行,只有打开php.ini,找到display_errors,设置为display_errors = Off。以后任何错误都不会提示。

[p][color=#383838]方法4 :做判断:isset($_GET["page"])      if-else判断[/color][/p] [p][color=#383838]或者加上''@''表示这行如果有错误或是警告不要輸出
如:@$page=$_GET["page"][/color][/p]
方法5:file1.php文件把$xx变量付一个值,用post传递给file2.php,
如果file2.php没有$xx的定义,而直接使用$yy=$xx; 系统就会报错:"undifined variaable $xx", 如果file2.php的文件开始用$xx="";定义,那么file1.php的$xx值就传不过来了!

file2.php里可以这样
if(!isset($xx)) $xx="";


本帖由 husw 于 2011-03-21 12:39:24 编辑过
2011-03-21 12:38:36 我的个人网站:www.husw.net