-
Notifications
You must be signed in to change notification settings - Fork 0
/
auth.php
38 lines (29 loc) · 1022 Bytes
/
auth.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
<?php
session_start();
// if(isset($_SESSION['userid'])==false)
// {
// header('location:/ml/index.html');
// }
include("config.php");
if(isset($_POST['login']))
{
$myusername = mysqli_real_escape_string($db,$_POST['ID']);
$mypassword = mysqli_real_escape_string($db,$_POST['PASSWORD']);
$_SESSION['userid'] = $myusername;
if((!empty($myusername))&&(!empty($mypassword)))
{
$sql = "SELECT email FROM auth WHERE email = '$myusername' and password = '$mypassword'";
$result = mysqli_query($db,$sql);
// $row = mysqli_fetch_array($result,MYSQLI_ASSOC);
$count = mysqli_num_rows($result);
if($count == 1)
{ //echo $_SESSION;
header("location:/summary/main.html");;
}
else
{
echo "Wrong credentials";;
}
}
}
?>