amol0010
08-30-2007, 09:58 PM
Hi,
I have created three .PHP files as main.php which asks for username, password and forwards it to checklogin.php which has connection details for the MySQL database.
After entering login details on main.php, it successfully checks if the username and password entered are correct or not, and shows the appropriate message, which means that main.php and checklogin.php are working correctly.
checklogin.php forwards the browser to the third .php script
login_success.php
the contents of login_success.php are as follows :
<?php
session_start();
if(!session_is_registered('username')){
header("location:main.php");
}
?>
<html>
<body>
Login Successful
</body>
</html>
However, this file still shows Login Successful even if I clear my cache/history/cookies after typing this in the browser :
http://mydomain/login_success.php
instead of taking the browser to the main.php login screen
What's wrong with the code ??
Thanks
I have created three .PHP files as main.php which asks for username, password and forwards it to checklogin.php which has connection details for the MySQL database.
After entering login details on main.php, it successfully checks if the username and password entered are correct or not, and shows the appropriate message, which means that main.php and checklogin.php are working correctly.
checklogin.php forwards the browser to the third .php script
login_success.php
the contents of login_success.php are as follows :
<?php
session_start();
if(!session_is_registered('username')){
header("location:main.php");
}
?>
<html>
<body>
Login Successful
</body>
</html>
However, this file still shows Login Successful even if I clear my cache/history/cookies after typing this in the browser :
http://mydomain/login_success.php
instead of taking the browser to the main.php login screen
What's wrong with the code ??
Thanks