I am new to PHP
i am making a simple login functionality for user with php & mysql
Here i want to make a simple thing where when a user after "loggingin" if presses back button he shouldn't get the login page back on screen.
I have tried using JS history.forward but its little wierd...
It shows glimps of login page for a second and takes back user to same page from where he presses back button...
How to make a facebook like functionality where login page never appears after loging in even on pressing back button..
Please HELP...:)
<?php
include_once 'conn.php';
if (isset($_SESSION['username'])) {
header('location:home.php');
}
if (isset($_REQUEST['btnsignin'])) {
if ($_REQUEST['txtemail'] <> "" && $_REQUEST['txtpass'] <> "") {
$email = $_REQUEST['txtemail'];
$pass = $_REQUEST['txtpass'];
$q = mysql_query("SELECT * FROM register WHERE emailid = '" . $email . "' && password = '" . $pass . "'");
while ($row = mysql_fetch_assoc($q)) {
$_SESSION['username'] = $email;
$_SESSION['userid'] = $row['uid'];
header('location:home.php');
}
}
}
?>