-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.php
194 lines (139 loc) · 5.7 KB
/
register.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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<?php
include 'userinfo.php';
error_reporting(0);
session_start();
if (isset($_SESSION['username'])) {
header("Location: login.php");
}
if (isset($_POST['submit'])) {
$username = $_POST['username'];
$email = $_POST['email'];
$password = md5($_POST['password']);
$cpassword = md5($_POST['cpassword']);
if ($password == $cpassword) {
$sql = "SELECT * FROM users WHERE email='$email'";
$result = mysqli_query($conn, $sql);
if (!$result->num_rows > 0) {
$sql = "INSERT INTO users (username, email, password)
VALUES ('$username', '$email', '$password')";
$result = mysqli_query($conn, $sql);
if ($result) {
echo "<script>alert('Wow! User Registration Completed.')</script>";
$username = "";
$email = "";
$_POST['password'] = "";
$_POST['cpassword'] = "";
header("Location: login.php");
}
else {
echo "<script>alert('Woops! Something Wrong Went.')</script>";
}
} else {
echo "<script>alert('Woops! Email Already Exists.')</script>";
}
} else {
echo "<script>alert('Password Not Matched.')</script>";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<title>home page</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="welcome.php">
<img src="images\img3.png" width="140" height="100" class="d-inline-block align-top" alt="">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="about_us.php"> About Us <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active" >
<a class="nav-link" href="do_your_bit.php"> Do Your Bit <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="contact_us.php">Contact Us <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="our_volunteers.php">Our Volunteers <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="donate.php">DONATE <span class="sr-only">(current)</span></a>
</li>
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
SignUp/Login
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="register.php">SignUp</a>
<a class="dropdown-item" href="login.php">Login</a>
</div>
</div>
</ul>
</div>
</nav>
<section class="my-5">
<div class="register-inner">
<div class="py-5">
<h3 class="text-center">SignUp</h3>
</div>
<div>
<div class="w-50 m-auto">
<form action="" method="POST" class="login-email">
<div class="form-group">
<label>Full Name</label>
<input type="text" placeholder="Full Name" class="form-control" name="username" value="<?php echo $username; ?>" required>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" placeholder="Email" class="form-control" name="email" value="<?php echo $email; ?>" required>
</div>
<div class="form-group">
<label>Password</label>
<input type="password" placeholder="Password" class="form-control" name="password" value="<?php echo $_POST['password']; ?>" required>
</div>
<div class="form-group">
<label>Confirm Password</label>
<input type="password" placeholder="Confirm Password" class="form-control" name="cpassword" value="<?php echo $_POST['cpassword']; ?>" required>
</div>
<br></br>
<div>
<button name="submit" class="btn btn-success">Register</button>
</div>
<br></br>
<p class="login-register-text">Have an account? <a href="login.php">Login Here</a>.</p>
</div>
</form>
</div>
</div>
</div>
</setion>
<br></br>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<footer class="p-3 bg-dark text-white text-center">
<div >
<p >
<div>@do-nation</div><br>
<div>All donations are tax exempted as eligible under section 80G of the Income Tax Act, 1961.</div></p><br>
<div>DO_NATION Food Bank is registered u/s 80 G of the Income Tax Act 1961 vide registration number Pan AADTR4438G.
</div></p><br>
<div>The above contribution is approved by the Commissioner of Income Tax (exceptions) u/s 80 G of the Income Tax Act 1961 vide approval letter no. CIT (E) /80G/3103-B/2018-19 dated February 20, 2019.
</div></p><br>
<div>Registered Office: D-703, Sainath Towers, Neelam Nagar, Phase -2, Mulund East, Mumbai 400081.
</div></p><br>
</div>
</footer>
</body>
</html>