login.php
<form action="check.php" method="post">
Enter username<input type="text" name="name">
Enter username<input type="password" name="pass">
<input type="submit" value="login">
</form>
check.php
<?php
session_start();
$uname=$_POST['name'];
$pass=$_POST['pass'];
if($uname=='unpossible' && $pass=='pog')
{
$_SESSION['logged_in']='1';
include('sensitive_data.php');
}
else
{
echo "get out from here";
}
?>
sensitive_data.php
<?php
if(isset($_SESSION['logged_in']))
{
?>
this page has sensitive data. very important data.
<?php
}
else
{
include('login.php');
}
?>
can u show the code when u are connected to database
ReplyDeleteNo need to this is for the client
Deletewwwww
ReplyDelete