-
Notifications
You must be signed in to change notification settings - Fork 0
/
UserRegistration.php
73 lines (64 loc) · 3.33 KB
/
UserRegistration.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
<?php
require("db_connection.php");
if(isset($_POST['Signup']))
{
if(($_REQUEST['rName']=="") || ($_REQUEST['rEmail']=="") || ($_REQUEST['rPassword']==""))
{
$msg='<div class="alert alert-warning text-danger text-center mt-2" role="alert">***All Field are Require***</div>';
}
else
{
$sqli="Select mail from requestor_login where mail = '".$_REQUEST['rEmail']."'";
$result=$con->query($sqli);
if($result->num_rows==1)
{
$msg='<div class="alert alert-warning text-danger text-center mt-2" role="alert">E-Mail already Registered</div>';
}
else
{
$name=$_REQUEST['rName'];
$email=$_REQUEST['rEmail'];
$password=$_REQUEST['rPassword'];
$sql="Insert into requestor_login (name, mail, password) values ('$name', '$email', '$password')";
if($con->query($sql)===TRUE);
{?>
<script>
alert ("Registration Successful");
</script>
<?php
}
}
}
}
?>
<!-- Start Registration Form Section-->
<div class="container pt-5 "id="Registration">
<h2 class="text-center">Create an Account</h2>
<div class="row mt-4 mb-4">
<div class="col-md-6 offset-md-3">
<form action="" method="post" class="shadow-lg p-4">
<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">E-Mail</label>
<input type="email" class="form-control" placeholder="username@example.com" aria-describedby="emailHelp" name="rEmail">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<i class="fas fa-key"></i><label for="" class="font-weight-bold pl-2">Password</label>
<input type="password" class="form-control" placeholder="Password" name="rPassword">
</div>
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1">Check me out</label>
</div>
<button type="submit" class="btn btn-danger btn-lg btn-block shadow-sm font-weight-bold" name="Signup">Sign Up</button>
<em style="font-size:12px">Note - By clicking Sign Up, you agree to our Terms, Data Policy and Cookie Policy</em><br>
<?php if(isset($msg)){ echo "$msg"; } ?>
</form>
</div>
</div>
</div>
<!-- End Registration Form Section-->