Php error message: "Warning: Unknown: Your script..."

Hello all,

I’m currently getting this php error:

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

Here is my code:

<div id="navigation">
   <hr />
      <span class="class1">
	<a class="home" href="index.php">Blog</a>  ||
	<a class="submit" href="input.php">Post a entry</a>  ||
	<?php if( strcmp( $_SESSION["logged_in"], "OK!" ) == 0): ?>
	<a class="logout" href="logout.php">Logout</a>
   <hr />	
	$result = mysql_query("SELECT timestamp, id, title, author FROM micro_blog_posts ORDER BY id DESC");
	   while($row = mysql_fetch_array($result)) 
	       $date  = date("l F d Y",$row['timestamp']);
	       $id = $row['id'];
	       $title = strip_tags(stripslashes($row['title']));
	       $author = stripslashes($row['author']);
	          if (mb_strlen($title) >= 20) 
		        $title = substr($title, 0, 20);
		        $title = $title . "...";
		print("<a href=\\"update.php?id=" . $id . "\\">" . $date . " -- " . $author . " -- " . $title . "</a><br />");
		<?php else: ?>
		   <a href="login.php">Login</a>
		   <?php endif; ?>

Interestingly the error message disappears after a page refresh.

Any help would be appreciated.

Pat Chuprina

Sorry, not sure what you mean. Please forgive me, am I missing something?



I’m using php 5.12. Looking forward to your next reply, since I am learning this.

What version of php are you using?

Code from further up:

$db_host     = "xxx.x.x.x";
$db_user     = "xxxxx_xxxxxxxx";
$db_password = "xxxxxxxxxx";
$db_name = "xxxxxxxxxxxx";
// connect to mysql server
    include( "include/" );

Thank you. What should I do? I’m getting excited!!!

Do you use session_start() either further up in the file or in another file which includes that file?

<?php if( strcmp( $_SESSION["logged_in"], "OK!" ) == 0): ?> 

Where are you setting the value for $_SESSION[‘logged_in’] ?