-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
29 lines (25 loc) · 869 Bytes
/
login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
{
$email = $_POST['email1'];
$password = $_POST['password1'];
// Create connection
$conn = mysqli_connect("localhost", "u120831222_root","khairwal","u120831222_data");
// Check connection
if(!$conn)
{
die("Connection failed:".mysqli_connect_error());
}
else
{
$query = mysql_query("select * from users where password='$password' AND email='$email'", $conn);
$rows = mysql_num_rows($query);
if ($rows == 1) {
$_SESSION['login_user']=$email; // Initializing Session
header("location: videos.html"); // Redirecting To Other Page
} else {
$error = "Username or Password is invalid";
}
mysqli_close($conn);
}
}
?>