473,237 Members | 1,221 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 software developers and data experts.

PHP Session Warning

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
0 1870

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Damien | last post by:
Hi to all, I'm currently re-designing our intranet : nice and lean CSS2, cleaned-up PHP 4.3.7, better-normalized MySQL ;o). So I've started using the $_SESSION variable instead of register_globals...
5
by: Phil Grimpo | last post by:
I have a very odd situation here. I have an administration page, where based on a users permissions, a recordset is called from the SQL server which has a list of paths to "Module Menus". Each of...
0
by: joseph conrad | last post by:
Hi, I tried to implement my own session handler in order to keep control on the process the drawback I foun it is not creating and storing in my cookie the PHPSESSID variable anymore. reading te...
19
by: lawrence k | last post by:
How can I find out where my script is outputting to the screen for the first time? My error logs are full of stuff like this: PHP Warning: session_start(): Cannot send session cache...
0
by: cty | last post by:
Title: Problem in session using php5 Good day, I use php5+mySQL4+IIS5.x Previuosly i use php4 and no error occur,
3
by: mikeboston | last post by:
Hi, I am attempting to use php session variables on a server which is running Red Hat Linux, but the variables don't seem to be getting passed between pages. I have tried the same exact test...
1
by: KidQuin | last post by:
I am having problems with session value between pages. Happening in both firefox and IE7. I go between page by links so I know it's not header changes. I use session_start as the first line on the...
7
by: Erwin Moller | last post by:
Hi group, Does anybody know what causes the following Warning? __________________________________________________ Warning: Unknown(): Your script possibly relies on a session side-effect...
5
by: Twayne | last post by:
Hi, If ever a newbie wants to know how much he has to learn yet, he only has to look here<g>!! ANYway: PHP 5.2.5; XP Pro SP2+, local Apache Server My actual question is: How do I get a...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.