-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_student.php
More file actions
92 lines (91 loc) · 2.62 KB
/
Copy pathadd_student.php
File metadata and controls
92 lines (91 loc) · 2.62 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Registration Page</title>
</head>
<body>
<center>
<fieldset>
<form method="post" action="add_student.php">
<table>
<tr>
<td>First Name:</td>
<td><input type="text" name="fname" placeholder="Enter your first name" required>
</tr>
<tr>
<td>Last Name:</td>
<td><input type="text" name="lname" placeholder="Enter your last name" required>
</tr>
<tr>
<td>User Name:</td>
<td><input type="text" name="uname" placeholder="Enter your user name" required>
</tr>
<tr>
<td>Gender:</td>
<td>
<input type="radio" name="gender" value="Male" required> Male
<input type="radio" name="gender" value="Female" required> Female
</td>
</tr>
<tr>
<td>Email Address:</td>
<td><input type="email" name="email" placeholder="Enter your email" required>
</tr>
<tr>
<td>Phone Number:</td>
<td><input type="tel" name="number" placeholder="Enter your phone number" required>
</tr>
<tr>
<td>Address:</td>
<td><textarea name ="address" placeholder="Enter your address" required></textarea></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="pass1" placeholder="Enter your password" required>
</tr>
<tr>
<td>Confirm Password:</td>
<td><input type="password" name="pass2" placeholder="Enter your password again" required>
</tr>
</table>
<input type="submit" name="signup" value="Signup">
<!--<input type="submit" name="back" value="Back">-->
</form>
<?php
@include 'dbcon.php';
if(isset($_POST['signup']))
{
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$uname = $_POST['uname'];
$gender = $_POST['gender'];
$email = $_POST['email'];
$number = $_POST['number'];
$address = $_POST['address'];
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
if($pass1 == $pass2)
{
$sql = "INSERT INTO student_registration(fname, lname, uname,gender, email, phone, address, password) VALUES ('$fname','$lname', '$uname', '$gender', '$email', '$number', '$address', '$pass1')";
$result=mysqli_query($conn,$sql);
if($result)
{
header('location:manage_s.php');
}
}
else
{
echo "<i>Password doesn't match</i>";
}
}
?>
<br>
<form method="post" action="reg.php">
<input type="submit" name="back" value="Back">
</form>
</fieldset>
</center>
</body>
</html>