-
Notifications
You must be signed in to change notification settings - Fork 4
/
register.php
134 lines (101 loc) · 6.03 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
<?php include('include/header.php'); ?>
<div class="container sign-in-up">
<div class="row">
<div class="col-md-6">
<h1>Online Furniture Store</h1>
<p>An online furniture shop that allows users to check for various furniture available at the online
store and purchase online. The project consists of list of furniture products displayed in various
models and designs. The user may browse through these products as per categories. If the user likes
a product he may add it to his shopping cart. Once user wishes to checkout he must
register on the site first. He can then login using same id password next time.</p>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-body">
<h1 class="text-center mt-5">Register Account</h1>
<form method="post" class="mt-5 p-3">
<?php
if(isset($_POST['register'])){
$fullname = $_POST['fullname'];
$email = $_POST['email'];
$password = $_POST['password'];
$conf_pass = $_POST['confirm-password'];
$address = $_POST['address'];
$city = $_POST['city'];
$postal_code = $_POST['code'];
$number = $_POST['phone_number'];
if(!empty($fullname) or !empty($email) or !empty($password) or !empty($conf_pass) or !empty($address) or !empty($city) or !empty($postal_code) or !empty($number)){
if($password === $conf_pass){
$cust_query="INSERT INTO customer(`cust_name`,`cust_email`,`cust_pass`,`cust_add`,`cust_city`,`cust_postalcode`,`cust_number`) VALUES('$fullname','$email','$password','$address','$city','$postal_code','$number')";
if(mysqli_query($con,$cust_query)){
$message="You Are Registered Successfully!";
}
}
else{
$error="Passwords do not Match";
}
}
else{
$error="All (*) Fields Required";
}
}
?>
<?php
if(isset($error)){
echo "<div class='alert bg-danger' role='alert'>
<span class='text-white text-center'> $error</span>
</div>";
}
else if(isset($message)){
echo "<div class='alert bg-success' role='alert'>
<span class='text-white text-center'> $message</span>
</div>";
}
?>
<div class="form-group">
<input type="text" name="fullname" placeholder="Full Name" class="form-control" >
</div>
<div class="form-group">
<input type="text" name="email" placeholder="Email" class="form-control" >
</div>
<div class="row">
<div class="col-md-6 col-sm-6 col-12">
<div class="form-group">
<input type="password" name="password" placeholder="password" class="form-control" >
</div>
</div>
<div class="col-sm-6 col-12 col-md-6 ">
<div class="form-group">
<input type="password" name="confirm-password" placeholder="Confirm password" class="form-control" >
</div>
</div>
</div>
<div class="form-group">
<input type="text" name="address" placeholder="Address" class="form-control" >
</div>
<div class="row">
<div class="col-md-6 col-6">
<div class="form-group">
<input type="text" name="city" placeholder="City" class="form-control" >
</div>
</div>
<div class="col-md-6 col-6">
<div class="form-group">
<input type="number" name="code" placeholder="Postal code" class="form-control" >
</div>
</div>
</div>
<div class="form-group">
<input type="number" name="phone_number" placeholder="Phone Number" class="form-control" >
</div>
<div class="form-group text-center mt-4">
<input type="submit" name="register" class="btn btn-primary" value="Register">
</div>
<div class="text-center mt-4"> Already a Member? <a href="sign-in.php"> Sign in </a></div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php include('include/footer.php');?>