By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,181 Members | 1,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,181 IT Pros & Developers. It's quick & easy.

PHP Session Warning

P: n/a
Hello,
I get this warning with my PHP code sometimes. It will come up, and
then after reloading the page once or twice, it will go away. Any
ideas? The code is below:

Warning: Unknown: Your script possibly relies on a session side-effect
which existed until PHP 4.2.3. Please be advised that the session
extension does not consider global variables as a source of data,
unless register_globals is enabled. You can disable this functionality
and this warning by setting session.bug_compat_42 or
session.bug_compat_warn to off, respectively. in Unknown on line 0

I understand that this has to do with using session_register, but I
don't use that anywhere in my code. My code looks like below:

<?php
session_start();
....
mysql_connect($hostname, $user,$password);
mysql_select_db($database);
$str_output = "<body>\n";
$str_output .= "<div class=\"dtree\">";
$str_output .= "<p><a href=\"javascript: d.openAll();\">open all</a> |
<a href=\"javascript: d.closeAll();\">\n";
$str_output .= "Close all</a></p>\n";
$str_output .= "<script type=\"text/javascript\">\n";
$str_output .= "d = new dTree('d');\n";
$str_output .= "d.add(0,-1,'Releases');";
$arr1 = array();
$arr2 = array();
$max_release = -1;

//Step 1
$sql_query = "SELECT RELEASE_INFO.*, RELEASE.XML_FILENAME FROM
RELEASE_INFO, RELEASE WHERE RELEASE.RELEASE_ID =
RELEASE_INFO.MAIN_REL_FILE_ID;";
$sql_result = mysql_query($sql_query);
$num_lines = 0;
$num_lines_2 = 0;
$arr_release = array();
$arr_rel_num = array();
while($sql_row = mysql_fetch_assoc($sql_result))
{
$arr1[release_num] = $sql_row[RELEASED_NUM];
$arr1[xml_filename] = $sql_row[XML_FILENAME];
$arr1[release_id] = $sql_row[MAIN_REL_FILE_ID];
//$arr1[dep_val] = $sql_row[NODE_ATTR_DETAIL_VAL];
array_push($arr2,$arr1);
if($arr1[release_num] > $max_release)
{
$num_lines_2 = $num_lines_2 + 1;
$max_release = $arr1[release_num];
// Step 3
//$arr_release[$arr1[release_num]][release_id] =
$arr1[release_id];
$arr_release[$arr1[release_num]][release_id] = 0;
$arr_release[$arr1[release_num]][tree_node] =
$num_lines_2;

}
$num_lines = $num_lines + 1;
// Step 2
$str_output .= "d.add(".$num_lines.",0,'Release
".$arr1[release_num]."','proc_check_xml.php?rel=".$arr1[release_num]."&par_id=-1','','main_frame2');";
}
$num_lines = $num_lines + 1;

//Step 4
$sql_query = "SELECT R.XML_FILENAME, RI.RELEASED_NUM, RR.* FROM RELEASE
AS R, RELEASE_INFO AS RI, REL_RELATIONSHIP AS RR WHERE
RR.CURR_RELEASE_ID = R.RELEASE_ID AND RR.RELEASE_INFO_ID =
RI.RELEASE_INFO_ID ORDER BY RELEASED_NUM ASC, HAS_CHILD DESC;";
$arr_tree = array();
$sql_result = mysql_query($sql_query);
$i2 = 0;
while($sql_row = mysql_fetch_assoc($sql_result))
{

//Step 5
$arr_tree[$i2][xml_filename] = $sql_row[XML_FILENAME];
$arr_tree[$i2][release_num] = $sql_row[RELEASED_NUM];
$arr_tree[$i2][parent_rel_id] = $sql_row[PARENT_RELEASE_ID];
$arr_tree[$i2][curr_rel_id] = $sql_row[CURR_RELEASE_ID];
$arr_tree[$i2][has_child] = $sql_row[HAS_CHILD];
$arr_tree[$i2][release_info_id] = $sql_row[RELEASE_INFO_ID];

$i2 = $i2 + 1;
}

$arr_tree_size = count($arr_tree);
$finished_flag = -1;

for($i3 = 0;$i3 < $arr_tree_size;$i3++)
{
for($i4 = $i3;$i4 < $arr_tree_size;$i4++)
{
if ($arr_release[$arr_tree[$i4][parent_rel_id]] != "")
{
$str_output .=
"d.add(".$num_lines.",".$arr_release[$arr_tree[$i4][parent_rel_id]][tree_node].",'".$arr_tree[$i4][xml_filename]."','info_session.php?rel_id=".$arr_tree[$i4][curr_rel_id]."','','main_frame2');";

$arr_release[$arr_tree[$i4][curr_rel_id]][release_id] =
$arr_tree[$i4][curr_rel_id];

$arr_release[$arr_tree[$i4][curr_rel_id]][tree_node] = $num_lines;
$arr_tree[$i4] = 0;
$num_lines = $num_lines + 1;
}
}
}

$str_output .= "document.write(d);";
$str_output .= "//-->\n";
$str_output .= "</script>\n";

$str_output .= "</body>\n";
$str_output .= "</html>\n";
echo $str_output;
?>
Thanks,
Jay
(patel at cs dot utk dot edu)

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.