我有一个相当困难的错误。以下函数是用于检索导航层的重复脚本。
//重复函数设置更高 级别导航树
function subLevels($ part_tree){
// print_r($ part_tree);//set new layer if initive if (empty ($part_tree['tree_name'])) { $grandchild_array = explode ("|", $part_tree['children'][0]); //populate the main array with the correct children for the new layer foreach ($grandchild_array as $key => $array) { if (is_array($array)) { foreach ($array as $inner_key => $current_id) { $result = mysql_query("SELECT children FROM
“。PRE。”导航WHERE id = '$ current_id'“);
$row = mysql_fetch_array($result); $new_child[$current_id] = $row['children']; } foreach ($new_child as $new_id => $row) { $part_tree['children'][$new_id] = $row['children']; } } else { // echo $array; $result = mysql_query("SELECT children FROM ".PRE."navigation WHERE
id ='$ array'“);
$row = mysql_fetch_array($result); $part_tree['children'][$array] = $row['children']; } } }
//创建当前图层
foreach($ part_tree ['children'] as $ key => $ child_string){
if (!empty ($child_string)) { $temp_array = explode ("|", $child_string); $part_tree['children'][$key] = $temp_array; } }
//查看是否需要新图层 每个孩子都有 ($ part_tree ['children'] as $ key => $ array){
if (!empty ($array)) { $temp_string = implode ("|", $array); $part_tree['children'][$key]['children'][]
= $ temp_string; $ part_tree = $ this - > subLevels($ part_tree ['children'] [$ key]);
}
}
返回$ part_tree;
}//function
我相信这是有缺陷的部分
//设置新图层如果是非常的 if(empty($ part_tree ['tree_name'])){ $ grandchild_array = explode(“|”,$ part_tree ['children'] [0]);
//populate the main array with the correct children for the new layer foreach ($grandchild_array as $key => $array) { if (is_array($array)) { foreach ($array as $inner_key => $current_id) { $result = mysql_query("SELECT children FROM
“。PRE。”导航WHERE id = '$ current_id'“); $ row = mysql_fetch_array($ result); $ new_child [$ current_id] = $ row ['children']; }
foreach ($new_child as $new_id => $row) { $part_tree['children'][$new_id] =
$行[ '孩子']; }
} else { // echo $array; $result = mysql_query("SELECT children FROM ".PRE."navigation WHERE
id ='$ array'“); $ row = mysql_fetch_array($ result);
$part_tree['children'][$array] = $row['children']; } } }
问题的本质是这样的:一旦我完成上面的部分,服务器就开始返回错误500.具体来说,一旦我完成了填充$ part_tree ['children'] [$ variable_name]的代码,我立即点击问题。
只有使用该数组元素集,该函数的其余部分才能工作。在第一次交互时,它以正确的格式提供,并在此处为每个子序列导航重新填充。
我唯一想到的解决方案就是我重复使用太深,服务器不喜欢它。我减少了导航表,因此任何给定的根级别都会导致最多3个其他,意味着该函数运行3次,但这并没有成功。在此之前,我一直在测试无限级别的回忆问题。
如果有人能为这500错误提供另一个理由,那我就听见了。
编辑:因此激活错误标记后 该网站返回了以下消息:
注意:未定义的索引:在第32行的/mnt/sw/2028751/web_applications/web/project_site/secure_includes/modules/users/index.php中过期
注意:未定义的属性:user :: $登录在第153行的/mnt/sw/2028751/web_applications/web/project_site/secure_includes/modules/users/class.php
注意:未定义的属性:user :: $登录在第153行的/mnt/sw/2028751/web_applications/web/project_site/secure_includes/modules/users/class.php
注意:第29行/mnt/sw/2028751/web_applications/web/project_site/secure_includes/modules/preprocessor/index.php中的未定义索引:expire_flag
注意:未定义的变量:第36行的/mnt/sw/2028751/web_applications/web/project_site/secure_includes/modules/preprocessor/index.php中的error404
而这一遍又一遍
注意:第91行/mnt/sw/2028751/web_applications/web/project_site/secure_includes/modules/navigation/class.php中的数组到字符串转换
我发现这个古怪的文件是我一直在处理的唯一文件是navigation / class.php
答案 0 :(得分:2)
首先,您可以尝试使用以下PHP代码启用错误报告:
ini_set('display_errors','On');
error_reporting(E_ALL);
我记得a previous question那里有很多帮助。
这可以帮助缩小范围或指定根本原因(或者在某些情况下,将它们全部修复)。 让我知道这是怎么回事,我会继续帮助。