Here is my code.
i want to show welcome message and firstname lastname in logout page from database when logged in correctly.
process.php
<?php
$email = $_POST['user'];
$password = $_POST['pass'];
$email = stripcslashes($email);
$password = stripcslashes($password);
$email = mysql_real_escape_string($email);
$password = mysql_real_escape_string($password);
mysql_connect("localhost", "root", "");
mysql_select_db("data");
$result = mysql_query("select * from user where email ='$email' and password = '$password'");
$row = mysql_fetch_array($result);
if($row['email'] == $email && $row['password'] == $password){
$_SESSION['email'] =$email;
$_SESSION['password'] =$password;
header("Location: lpage.html");
}
else{
echo "<script language=\"JavaScript\">\n";
echo "alert('User ID or Password was incorrect!');\n";
echo "window.location='login.html'";
echo "</script>";
}
?>
login.html
<p> User ID</p>
<p> Password</p>
</div>
</div>
<div class="s-11 l-6"><br>
<br>
<br>
<br>
<h2>User Login</h2>
<div class="customform" >
<div id="mail-status"></div>
<div class="block">
</div>
<div id="frm">
<form id="form" method="POST" action="process.php">
<div class="s-12 l-7">
<input type="email" id="user" name="user" required/></div>
<div class="s-12 l-7">
<input type="password" id="pass" class="masked" name="pass" required/></div>
<div class="s-3 l-7">
<button type="Login" id="btn" style="width: 100px; float: right; onClick="check(this.form)">Login</button></div>
logout.html
<code>