Jump to content

session side-effect error


pcw
 Share

Recommended Posts

Hi, I have this script which does what it is meant to do.

 

I have assigned session_id() to the variable $sid so I can use it when logging in to a users account, however I get this error. How do I get around this?

 

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

 

As this is going to be installed on many servers, I do not want to have to edit the php.ini file on each one so as not to get this error. Is there an alternative way to assign the session_id() as so $sid = session_id(); so this doesnt happen?

 

<div id="pageNav">
    <div id="sectionLinks"> <a href="admin.php?cmd=manage1&username=admin">Manage</a> <a href="admin.php?cmd=dashboard&username=admin">Dashboard</a> <a href="admin.php?cmd=msgcenter&username=admin">Message Center </a> <a href="admin.php?cmd=manage&username=logins">Logins</a> </div>
  </div>
  <div id="content">
    
    <div class="page">
     <table width="100%" border="1" align="center">
        <td bgcolor="#99FF66"><div align="center"><span class="style3">Login</span></div></td>
        <td bgcolor="#99FF66"><div align="center"><span class="style3">Name</span></div></td>
        <td bgcolor="#99FF66"><div align="center"><span class="style3">Registration Date </span></div></td>
        <td bgcolor="#99FF66"><div align="center"><span class="style3">Approved </span></div></td>
	        <td bgcolor="#99FF66"><div align="center"><span class="style3">Reset Password </span></div></td>
        <td bgcolor="#99FF66"><div align="center"><span class="style3">Delete</span></div></td>
      </tr>

<?php

session_start();

$sid = session_id();
session_register('sid');

include_once("data/mysql.php");

$mysqlPassword = (base64_decode($mysqlpword));

$db = mysql_connect("$localhost", "$mysqlusername", "$mysqlPassword") or die ("Error connecting to database");

mysql_select_db("$dbname", $db) or die ("An error occured when connecting to database");


$result = mysql_query("SELECT * FROM members");

while($row = mysql_fetch_assoc($result)){

echo "<tr><td><a href=templates/members/home.php?username=".$row['username']."&sid=$sid>".$row['username']."</a></td>
<td>".$row['firstname']." ".$row['lastname']."</td> 
<td>".$row['registration_date']."</td>
<td><a href=admin.php?cmd=approval&username=".$row['username']."&approved=".$row['approved'].">".$row['approved']."</a></td>
<td><a href=templates/members/changepw.php?username=".$row['username']."&sid=$sid>Change Password</a></td> 
<td><a href=templates/members/delete.php?username=".$row['username']."&sid=$sid>Delete</a></td></tr>";
}
?>
    </div>
    
  </div>  
</div>



       
      <tr>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
    </table>
    </div>
    
  </div>  
</div>


 

Many Thanks

 

Paul

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.