Basically, i dont want the user accessibly to the login page by clicking back button after he/she successfully login to the system.
Below us the code of login check.php:-
<?php
include 'database.php';
session_start();
if (isset ($_POST['namaPengguna']))
{
$kataLaluan = $_POST['kataLaluan'];
$namaPengguna = $_POST['namaPengguna'];
$query = "SELECT * FROM pengguna
WHERE namaPengguna='$namaPengguna' && kataLaluan = '$kataLaluan' ";
$result = $mysqli->query($query) or die($mysqli->error._LINE_);
$row = $result->num_rows;
$info = $result->fetch_assoc();
$_SESSION['PenggunanoKP']=$info['PenggunanoKP'];
if($row<1)
{
header("Location:login design.php");
}
else{
header("Location:pilihAction.php");
}
}
?>
The next page :
<?php include 'database.php';
include 'session.php';
?>
<?php
echo $_SESSION['PenggunanoKP'];
?>
/*html code