i do having this problems.. once log out the data from database still come out but the table structure already invisible..
how to completely disconnect from database when session end..
thank you...
how to completely disconnect from database when session end..
Code:
<?php define('INCLUDE_CHECK',true); require 'connect.php'; require 'functions.php'; // Those two files can be included only if INCLUDE_CHECK is defined // select record from mysql $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); session_name('Login'); session_set_cookie_params(2*7*24*60*60); session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Administrator Control Panel only!</title> <link rel="stylesheet" type="text/css" href="demo.css" media="screen" /> </head> <body> <div id="main"> <div class="container"> <h1>Registered Administrator Only!</h1> <h2>Login to view this resource!</h2> </div> <div class="container"> <?php if($_SESSION['id']) echo ' <table width="100%" border="0" cellspacing="1" cellpadding="0"> <tr> <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td colspan="8" bgcolor="#FFC600"><strong><center>Delete Temporary User & Password Here!</center></strong> </td> </tr> <tr> <td align="center" bgcolor="#FFFFFF"><strong>Id</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Name</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Pass</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Email</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>IP Address</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Date</strong></td> <td align="center" bgcolor="#FFFFFF"> </td> <td align="center" bgcolor="#FFFFFF"> </td> </tr>'; else echo '<h1>Unauthorize Area</h1>'; ?> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td bgcolor="#FFFFFF"><? echo $rows['id']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['usr']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['pass']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['email']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['regIP']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['dt']; ?></td> <td bgcolor="#FFFFFF"><a href="update.php?id=<? echo $rows['id']; ?>">update</a></td> <td bgcolor="#FFFFFF"><a href="delete_ac.php?id=<? echo $rows['id']; ?>"><font color="#FF0000">delete</font></a></td> </tr> <? // close while loop } // close connection; mysql_close(); ?> </table></td> </tr> </table> </div> </body> </html>
thank you...
Comment