I have a php script for authenticating users. But there is a problem.
When a user logs in with his username and password he can access the restricted pages. But what i want to do is, if a user presses back button then the user should get logged off. I'm using php.
Here is the code for login page....
http://www.abhinav.frih.net
When a user logs in with his username and password he can access the restricted pages. But what i want to do is, if a user presses back button then the user should get logged off. I'm using php.
Here is the code for login page....
| Code: |
| <?
session_start(); include("head.inc"); $mysql = mysql_connect("localhost","abhinavs",""); $uname = $_POST["uname"]; $pass = $_POST["pass"]; $result = mysql_db_query("abhin****","select *from pass where uname='$uname' and pass='$pass'"); $affected_rows = mysql_num_rows($result); if($affected_rows == 1) { print "<h2>$uname, You are now logged in</h2>"; $_SESSION['user_name'] = $uname; } else { print '<h2>Incorrect username or password. Please try logging-in again</h2>'; include("menu.inc"); die(); } |
http://www.abhinav.frih.net
