Here is my issue. When I log in it gives me username 1. when I click back and log in with a different name it gives me welcome username1.
How can I get this script to recognize the different sessions to accept multiple users without logging out. When I click log out, which is just session_destroy(); it gives me username2 when I log in with a different username than the first time.
Thanks.
<?
session_start();
session_destroy();
include('dbinfo.inc.php');
$query = "SELECT * FROM users WHERE username='$username' AND password='$password'";
$result = mysql_query($query) or die(mysql_error());
$rows = mysql_num_rows($result) or die(mysql_error());
if ($rows == '1') {
session_start();
session_register("username");
header("Location: secure.php");
} else {
echo" <font color='#000000'>ACCESS DENIED! </font> ";
}
?>
Tjat was the verify.php
Here is the secure.php page:
<?
session_start();
if (session_is_registered("username")) {
include('dbinfo.inc.php');
include('css.css');
include('top.php');
?>
<tr>
<td width=593 height=1 colspan=2><img src="/images/black.gif" width=100% height=1></td>
</tr>
<tr>
<td width=593 height=1 colspan=2><img src="/images/black.gif" width=100% height=1></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="656" align="center">
<tr>
<td colspan="2" width="621" bgcolor="#687B8C" valign="top">
<table cellpadding="10" cellspacing="0" border="0" width="654">
<tr>
<td valign="top"> <div align="center"></div>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#415369" width="465"><img src="/images/leftcorners_smallboxes.gif" alt="" border="0" width="32" height="32">
<font face="Tahoma" color="#ffffff" size="4"><b>Login Accepted!</b></font></td>
</tr>
<tr>
<td bgcolor="#415369" height="120" width="465"><div align="center">
<font color="#FFFFFF" size="2" face="Tahoma"><strong>Welcome
<?= $username ?>
</strong> </font></div></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?
include('bottom.php');
} else {
header("Location: [url]http://kaboom.ionichost.com/index.php[/url]");
}
?>
Thanks so much in advance.