-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserRegistration.php
More file actions
50 lines (49 loc) · 2.48 KB
/
Copy pathUserRegistration.php
File metadata and controls
50 lines (49 loc) · 2.48 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
<?php
include('dbConnection.php');
if(isset($_REQUEST['rSignup'])){
// Checking for Empty Fields
if(($_REQUEST['rName'] == "") || ($_REQUEST["rEmail"] == "") || ($_REQUEST['rPassword'] == "")){
$regmsg = '<div class="alert alert-warning mt-2" role="alert">All Fields are Required</div>';
} else {
// Email Already Registered
$sql = "SELECT r_email FROM requesterlogin_tb WHERE r_email ='".$_REQUEST['rEmail']."'";
$result = $conn->query($sql);
if($result->num_rows==1){
$regmsg = '<div class="alert alert-warning mt-2" role="alert">Email ID Already Registered</div>';
} else {
// Assigning User's Values to Variables
$rName = $_REQUEST['rName'];
$rEmail = $_REQUEST['rEmail'];
$rPassword = $_REQUEST['rPassword'];
$sql = "INSERT INTO requesterlogin_tb(r_name, r_email, r_password) VALUES('$rName', '$rEmail', '$rPassword')";
if($conn->query($sql) == TRUE){
$regmsg = '<div class="alert alert-success mt-2" role="alert">Account Succefully Created</div>';
} else {
$regmsg = '<div class="alert alert-danger mt-2" role="alert">Unable to Create Account</div>';
}
}
}
}
?>
<div class="container pt-5 " id="registration" >
<h2 class="text-center" >Create an Account</h2>
<div class="row mt-4 mb-4 " style="background-image:url(images/bg.png);" >
<div class="col-md-6 offset-md-3 " >
<form action="" class="shadow-lg p-4" method="POST">
<div class="form-group ">
<i class="fas fa-user"></i> <label for="name" class="font-weight-bold pl-2">Name</label><input type="text" class="form-control" placeholder="Name" name="rName">
</div>
<div class="form-group">
<i class="fas fa-user"></i> <label for="email" class="font-weight-bold pl-2">Email</label><input type="email" class="form-control" placeholder="Email" name="rEmail">
<small class="form-text">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<i class="fas fa-key"></i> <label for="pass" class="font-weight-bold pl-2">New Password</label><input type="password" class="form-control" placeholder="Password" name="rPassword">
</div>
<button type="submit" class="btn btn-primary mt-5 btn-block shadow-sm font-weight-bold" name="rSignup">Sign Up</button>
<em style="font-size:10px;">Note - By clicking Sign Up, you agree to our Terms, Data Policy and Cookie Policy</em>
<?php if(isset($regmsg)) {echo $regmsg;} ?>
</form>
</div>
</div>
</div>