-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_member_details_dvd.php
More file actions
124 lines (114 loc) · 4.53 KB
/
check_member_details_dvd.php
File metadata and controls
124 lines (114 loc) · 4.53 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
require_once "variables.php";
$con = mysqli_connect($hostname, $host_user, $host_pass, $host_database);
$username = $_POST[$html_username];
$password = $_POST[$html_password];
$phone = $_POST[$html_mobileno];
$query_phone = "SELECT * FROM data WHERE PhoneNo='$phone'";
$result = mysqli_query($con, $query_phone);
$row = mysqli_fetch_array($result);
$timepaid = date($time_format);
#query database to obtain the member info corresponding to the phone number entered
$query = "SELECT * FROM data WHERE Phoneno='$phone'";
$result = mysqli_query($con, $query);
$row = mysqli_fetch_array($result);
$name = $row[$sql_data_name];
$department = $row[$sql_data_department];
$year = $row[$sql_data_year];
$email = $row[$sql_data_email];
$paid = $row["Paid"];
#A html page displaying the details of the member(the person whose phone number was just entered)
$member_info = '<html>
<head>
<title>Login | LCC-SJCE</title>
<meta charset="utf-8" />
<meta name="author" content="LCC Member Login">
<meta name="description" content="Confirm Registration of new user LCC 2014">
<meta name="keywords" content="LCC, lcc, lcc login, LCC LOGIN, lcc login 2014, LCC LOGIN 2014, linux campus club sjce, SJCE Mysore lcc">
<meta name="viewport" content="user-scalable = yes">
<link href="./css/login-lcc.css" rel="stylesheet" media="screen">
<link rel="shrotcut icon" href="./images/logo.png">
<script type="text/javascript" src="./js/newregvalidate.js"></script>
</head>
<body>
<center>
<h1 style="color: white;"><b>ADMIN LOGIN - LCC</b></h1>
</center>
<hr style="color: white; border:1px dotted white;">
<form action="login-dvd.php" method="post">
<center>
<table>
<tr>
<td style="color: white; font-family:arial,sans-serif; -webkit-font-smoothing:antialiased; font-size:120%;">Name :'.$name.' </td>
</tr>
<br>
<br>
<tr>
<td style="color: white; font-family:arial,sans-serif; -webkit-font-smoothing:antialiased; font-size:120%;">Department : '.$department.'</td>
</tr>
<br>
<tr>
<td style="color: white; font-family:arial,sans-serif; -webkit-font-smoothing:antialiased; font-size:120%;">Year : '.$year.' </td>
</tr>
<tr>
<td style="color: white; font-family:arial,sans-serif; -webkit-font-smoothing:antialiased; font-size:120%;">Email : '.$email.' </td>
</tr>
<tr>
<td style="color: white; font-family:arial,sans-serif; -webkit-font-smoothing:antialiased; font-size:120%;">Paid : '.$paid.' </td>
</tr>
</table>
<b style="padding-left: 50px;"></b>
<input type="submit" value="Cancel" style="border-radius: 22px;">
</center>
</form>
<br>
<br>
<hr style="color: white; border:1px dotted white;">
<form action="validate_dvd.php" name="newregistration" onsubmit="return(validate());" method="post" >
<div class="container">
<center>
<label style="color: white;" for="username">Username:</label>
<input type="text" id="username" name="Username" value="'.$username.'">
<br>
<br>
<label style="color: white;" for="password">Password:</label>
<input type="password" id="password" name="Password" value="'.$password.'">
<br>
<br>
<label style="color: white;" for="mobileno">Mobile No:</label>
<input type="text" id="Mobileno" name="Mobileno" value="'.$phone.'">
<br>
<b style="padding-left: 50px;"></b>
<input type="submit" value="Confirm" style="border-radius: 22px;">
</center>
</div>
</form>
<br>
</body>
</html>';
if(count($row) == 0)
echo $not_registered;
else
{
#query the database to check for login credentials
$query_check = "SELECT * FROM admins WHERE Username='$username' AND Password='$password'";
$result = mysqli_query($con, $query_check);
$row = mysqli_fetch_array($result);
if(count($row) > 0)
{
#login details are true
if(($row[$sql_admins_username] == $username) and ($row[$sql_admins_password] == $password)) #Prevents sql injection
{
#query the database to know whther the user paid or not
$check_query = "SELECT Paid FROM data WHERE PhoneNo='$phone'";
$check_result = mysqli_query($con, $check_query);
$row = mysqli_fetch_array($check_result);
echo $member_info;
}
else
echo $invalid_login;
}
else
echo $invalid_login;
}
?>