Here's the situation:
I have a username/password table. In the login page is a script to match username and password to the db. Basic stuff, right?
Ok. When I login under my ID, I can login fine. When anyone else trys to login they cannot, even though eveerything matches up with the db entries. However, if I change any other users password to be mine, they can login fine.When I change my own password to soemthing else, I can noo longer login.
I use session_unset and session_destroy to kill sessions and I have even logged out of all windows. same problem.
So a friend of mine and I have been agonizing over the problem. He has installed the identical setup I have on his server and it works fine on his but not on mine. I have also uploaded this to another MySQL server with a different host and it still doesn't work for me. So i imagine that eliminates MySQL as the problem.
I have also checked the page through N6 and IE6...same problem. so I imagine that eliminates this as a browser problem.
The only thing I can think of is that something is cacheing wrong somewhere and not getting cleared. Here's my PHP and db dump:
code:
#
Table structure for table admin_login
#
CREATE TABLE admin_login (
user varchar(8) NOT NULL default '',
password varchar(11) NOT NULL default '',
fullname varchar(20) NOT NULL default '',
UNIQUE KEY user (user)
) TYPE=MyISAM;
and the PHP:
PHP:
<?php
include("funclib.inc"); //dbConnect function info here
session_start();
if(!isset($user) or !isset($password)) {
session_register('user');
session_register('password');
//HTML form
include("loginhtml.inc");
exit;
} dbConnect();
$lquery = "SELECT * FROM admin_login WHERE user = '$user' AND password = '$password'";
$result = mysql_query($lquery);
$row = mysql_fetch_array($result);
$fullname=$row['fullname'];
echo("$fullname");
if (!$row)
{ // no user is found
session_unregister('user');
session_unregister('password');
session_unset();
session_destroy();
include ("noentry.inc");
exit;
}
?>
Any clues?
Aaron