-
Notifications
You must be signed in to change notification settings - Fork 0
/
regform.php
125 lines (106 loc) · 2.76 KB
/
regform.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
<!DOCTYPE html>
<html>
<head>
<title>Customer Registration</title>
<style type="text/css">
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
}
h1 {
text-align: center;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
font-weight: bold;
margin-bottom: 5px;
}
input[type="text"],
input[type="email"],
input[type="password"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
.btn {
display: block;
width: 100%;
padding: 10px;
font-size: 16px;
background-color: #76448A;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
.btn:hover {
background-color: #45a049;
}
body{
background-image:url("back.jpg");
background-repeat: none;
}
</style>
</head>
<body>
<div class="container">
<h1>Customer Registration</h1>
<form action="regform.php" method="post" id="registration-form">
<div class="form-group">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
</div>
<div class="form-group">
<label for="email">Contact Number:</label>
<input type="text" id="num" name="number" maxlength="10" required>
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="password" id="password" name="password" minlength="8" maxlength="12" required>
</div>
<div class="form-group">
<label for="confirm-password">Confirm Password:</label>
<input type="password" id="confirm-password" name="confirm-password" minlength="8" maxlength="12" required>
</div>
<div class="form-group">
<label>Date of Birth(YYYY-MM-DD):</label>
<div class="dob-group">
<input type="text" id="dob" name="dob" required>
</div>
<br><br>
<div class="address">
<label for="address">Address :</label>
<textarea name="address" cols="60" rows="5" placeholder="Enter text here..."></textarea>
<br><br>
</div>
<center><input type="submit" value="Register" class="btn" name="register"></center>
</form>
</div>
<script src="registration.js"></script>
</body>
</html>
<?php
require 'connection.php';
if(isset($_POST['register'])){
$name=$_POST['name'];
$contact=$_POST['number'];
$psw=$_POST['password'];
$cpsw=$_POST['confirm-password'];
$DOB=$_POST['dob'];
$add=$_POST['address'];
$query= "INSERT INTO customer_reg VALUES ('','$name','$contact','$psw','$cpsw','$DOB','$add')";
//mysqli_query($conn, $query);
if(mysqli_query($conn, $query) === true) {
die( "<script> alert('Information inserted successfully')</script>");
header("Location: home.php");
}
else{
echo "error";
}
}
?>