-
Notifications
You must be signed in to change notification settings - Fork 4
/
login_V.php
40 lines (25 loc) · 988 Bytes
/
login_V.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
30
31
32
33
34
35
36
37
38
39
40
<?php
include "db/db.php";
session_start();
if(isset($_POST["email"]) && isset($_POST["password"])){
$email = mysqli_real_escape_string($con,$_POST["email"]);
$password = md5($_POST["password"]);
$sql = "SELECT * FROM user_info WHERE email = '$email' AND password = '$password'";
$run_query = mysqli_query($con,$sql);
$count = mysqli_num_rows($run_query);
if($count == 1){
$row = mysqli_fetch_array($run_query);
$_SESSION["uid"] = $row["user_id"];
$_SESSION["name"] = $row["first_name"];
$_SESSION["lnam"] = $row["last_name"];
$FT = $_SESSION["name"];
$LT = $_SESSION["lnam"];
echo"<div class='alert alert-success' role='alert'>Welcome <b>$FT $LT</b><br>login is Success
</div>";
exit();
}else{
echo "<div class='alert alert-danger' role='alert'><span style='color:red;'>Please Check Email And Password Again Enter </span></div>";
exit();
}
}
?>