-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsuccess.php
More file actions
83 lines (71 loc) · 2.56 KB
/
success.php
File metadata and controls
83 lines (71 loc) · 2.56 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
<?php
$title = 'success registration';
require 'includes/header.php';
require_once 'database/conn.php';
//save data into database
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['user_id'])) {
$id = $_POST['user_id'];
} else {
$id = 'A user without ID';
}
if (isset($_POST['firstname'])) {
$firstname = $_POST['firstname'];
} else {
$firstname = 'A user without firstname name';
}
if (isset($_POST['secondname'])) {
$secondname = $_POST['secondname'];
} else {
$secondname = 'A user without a secondname';
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$role = $_POST['role'];
} else {
$role = 'A user without a role';
}
if (isset($_POST['email'])) {
$email = $_POST['email'];
} else {
$email = 'A user without a email';
}
if (isset($_POST['phonenumber'])) {
$phonenumber = $_POST['phonenumber'];
} else {
$phonenumber = 'A user without a phonenumber';
}
if (isset($_POST['schoolname'])) {
$schoolname = $_POST['schoolname'];
} else {
$schoolname = 'A user without a schoolname';
}
if (isset($_POST['studentlevel'])) {
$studentlevel = $_POST['studentlevel'];
} else {
$studentlevel = 'A user without a studentlevel';
}
if (isset($_POST['teacherSubject'])) {
$teacherSubject = $_POST['teacherSubject'];
} else {
$teacherSubject = 'A user without a teacherSubject';
}
$isSuccess = $crud->insertSchoolmanager_Admin($firstname, $secondname, $role, $email,$username, $password, $phonenumber, $schoolname);
if ($isSuccess) {
echo '<h1 class="text-center text-success">You have been registered successfully</h1><br>
<h3 class="p-3 mb-2 bg-success text-white">Please confirm your email before login</h3>';
} else {
echo '<h1 class="text-center text-danger">Registration was unsuccessful</h1>';
}
}
?>
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title"><?php echo $_POST['firstname'] . "\t" . $_POST['secondname']; ?></h5>
<h6 class="card-subtitle mb-2 text-muted"><?php echo $_POST['role']; ?></h6>
<p class="card-text">Email:<?php echo $_POST['email']; ?></p>
<p class="card-text">Password:<?php echo $_POST['password']; ?></p>
<p class="card-text">Phone Number:<?php echo $_POST['phonenumber']; ?></p>
<a href="./login.php" class="card-link">Login Here</a>
</div>
</div>
<?php require 'includes/footer.php' ?>