-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew_user.php
More file actions
179 lines (166 loc) · 6.46 KB
/
new_user.php
File metadata and controls
179 lines (166 loc) · 6.46 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
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
<? ob_start(); ?>
<?php
session_start();
ob_start();
include("config.php")
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RMS</title>
<link rel="stylesheet" href="style.css?v=<?php echo time();?>">
<script src="jquery.min.js"></script>
<script>
$(document).ready(function()
{
$("#p2").bind("blur",passsword_check);
});
function passsword_check()
{
var p1=$("#p1").val();
var p2=$("#p2").val();
if(p1!=p2)
{
$("#pass_err").html("Miss match password");
}
else
{
$("#pass_err").html("");
$("#pass_crr").html("password matched")
}
}
</script>
</head>
<body>
<div id="header">
<div id="logo">
<!-- <img src="assets/logo.jpg" height="100px" width="120px"> -->
<svg xmlns="http://www.w3.org/2000/svg" width="150" height="100" fill="#000000" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"></rect><line x1="24" y1="216" x2="168" y2="216" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line><path d="M16.9,140.4l37.7,35.3a32,32,0,0,0,38,4.3L244,92,225.4,69.2a32,32,0,0,0-41-7.3L140,88,80,68,63.5,75.1a8,8,0,0,0-2.2,13.3L92,116,64,132,36,120l-16.8,7.2A8,8,0,0,0,16.9,140.4Z" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>
</div>
<div id="logoHeading">
<center>
<h1>Recruitment Management System</h1>
</center>
</div>
</div>
<div id="nav">
<ul id="navMenu">
<li><a href="index.php">Home</a></li>
<li><a href="about.php">AboutUs</a></li>
<li><a href="contact.php">ContactUs</a></li>
<li><a href="login.php">SignIn</a></li>
</ul>
</div>
<div id="container">
<h2>New User Registration</h2>
<fieldset class="shadow" id="user-login">
<legend>User Registration</legend>
<form method="post" action="new_user.php" autocomplete="off">
<table id="user-table">
<tr>
<td>Name:</td>
<td><input type="text" name="name" required></td>
</tr>
<tr>
<td>User Name:</td>
<td><input type="text" name="uname" required></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="email" name="email" required></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="pass1" id="p1" required></td>
<td><i class="error" id="pass_err"></i></td>
<td><i class="correct" id="pass_crr"></i></td>
</tr>
<tr>
<td>confirm Password:</td>
<td><input type="password" name="pass2" id="p2" required></td>
</tr>
<tr>
<td>Security Question:</td>
<td>
<select name="ques">
<option value="What is your pet?">What is your pet?</option>
<option value="What is your color?">What is your color?</option>
<option value="What is your bike?">What is your bike?</option>
<option value="What is your pen?">What is your pen?</option>
<option value="What is your pet name?">What is your pet name?</option>
</select>
</td>
</tr>
<tr>
<td>
Answer:
</td>
<td>
<input type="text" name="answer" required>
</td>
</tr>
<tr>
<td><input type="submit" value="save"name="submit"></td>
<td><input type="reset" value="clear" name="reset"></td>
</tr>
<tr>
<td></td>
<td><a href="login.php">Already User</a></td>
</tr>
</table>
</form>
</fieldset>
<?php
if(isset($_POST["submit"]))
{
$name=$_POST["name"];
$uname=$_POST["uname"];
$email=$_POST["email"];
$pass1=$_POST["pass1"];
$pass2=$_POST["pass2"];
$ques=$_POST["ques"];
$answer=$_POST["answer"];
if($name!=""&&$uname!=""&&$email!=""&&$pass1!=""&&$pass2!=""&&$ques!=""&&$answer!="")
{
if($pass1==$pass2)
{
$sql="INSERT INTO users
(NAME,USERNAME,EMAIL,PASSWORD,QUESTION,ANSWER)
VALUES
('$name','$uname','$email','$pass1','$ques','$answer')";
if($con->query($sql))
{
header("location:login.php?mes=<p class='correct'>You sucessfull joined, Please login here.</p>");
}
else
{
echo "<p class='error'>Some Error Try Again Later</p>";
}
}
else
{
echo "<p class='error'>Confirm password and Password Must be Same";
}
}
else
{
echo "<p class='error'>All Fields Required</p>";
}
}
else
{
echo "<p>Please Fill All The Details</p>";
}
?>
</div>
<div id="footer">
<center>
©2022 All Rights Reserved. Designed by <q>David, Suseendaran, Mugilan </q>
</center>
</div>
</body>
</html>
<? ob_flush(); ?>