forked from students-alumni-cell-iitkgp/sac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hclogin.php
31 lines (27 loc) · 837 Bytes
/
hclogin.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
<?php
require 'connection.php';
session_start();
$email=$_POST['email'];
$password=$_POST['password'];
$password_hash=hash('sha256', $password);
if (!empty($email)&&!empty($password)) {
$query="SELECT * FROM users WHERE email='".$email."' AND password='".$password_hash."'";
//echo "cont..";
$result = $connection->query($query);
// $query_num_rows=mysqli_num_rows($result);
//echo $query_num_rows;
/*if ($query_num_rows==10) {
echo '<script language="javascript">alert("Invalid Email ID/PASSWORD ");</script>';
}*/
//echo $result->num_rows;
if ($result->num_rows > 0) {
//$user_id=mysql_result($query_run, 0,'email');
$_SESSION['email']=$email;
echo '2';
}else
echo '1';
//}
}else {
echo '0';
}
?>