You are on page 1of 2

<?

php
session_start();
?>

<html>
<head>
<title>Login</title>
</head>
<body>

<form role="form" method="post" action="Login.php">


<table align="center" border="1" width="600">
<tr>
<th colspan="2" style="height:50px;background:yellow;">Sign In</th>
</tr>
<tr>
<td>Email_ID:</td>
<td><input type="text" name="email" placeholder="please enter email here"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password" placeholder="please enter Password
here"></td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" name="login" value="login">
</td>
</tr>
</table>
</form>

</body>
</html>

<?php

include("Database.php");

if(isset($_POST['login']))
{
$user_email=$_POST['email'];
$user_pass=$_POST['password'];

$check_user="select * from jhb WHERE email='$user_email' AND


password='$user_pass'";

$run=mysqli_query($dbcon,$check_user);

if(mysqli_num_rows($run))
{
echo "<script>window.open('Welcome.php','_self')</script>";

$_SESSION['email']=$user_email;

}
else
{
echo "<script>alert('You Are Not Registered User! Please first Register at
Registration.php')</script>";

}
}
?>

You might also like