-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidation.php
More file actions
64 lines (46 loc) · 1.17 KB
/
validation.php
File metadata and controls
64 lines (46 loc) · 1.17 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
session_start();
$con = mysqli_connect('localhost','root');
if($con)
{
echo "Sign Up Successfully";
}
else{
echo "no connection";
}
mysqli_select_db($con, 'signup');
$user_email = $_POST['user_email'];
$user_password = $_POST['user_password'];
$q = "SELECT * from signupdata where user_email = '$user_email' && user_password='$user_password' ";
$result = mysqli_query($con, $q);
$num = mysqli_num_rows($result);
$q1 = "SELECT * FROM signupdata ORDER BY disease DESC, dt_time ASC";
$result1 = mysqli_query($con, $q1);
if($num ==1){
while($row = $result->fetch_assoc())
{
$user_name = $row['user_name'];
$sco= $row['disease'];
$gender= $row['gender'];
}
$count=1;
while($row2= $result1 -> fetch_assoc())
{
if($row2['disease']==$sco && $row2['user_name']==$user_name)
{
break;
}
else{
$count++;
}
}
$_SESSION['user_name'] = $user_name;
$_SESSION['gender'] = $gender;
$_SESSION['disease'] = $sco;
$_SESSION['ivac']= $count;
header('location:home.php');
}
else{
header('location:login.php');
}
?>