-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsuccess.php
63 lines (54 loc) · 2.04 KB
/
success.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
<?php
$title = 'Success';
require_once 'includes/header.php';
require_once './db/conn.php';
require './includes/sanitise.php';
if(isset($_POST['submit'])){
//extract values from the $_POST array
$fname = test_input($_POST['fname']);
$lname = test_input($_POST['lname']);
$dob = test_input($_POST['dob']);
$username = test_input($_POST['mail']);
$contact = test_input($_POST['phone']);
$course1 = test_input($_POST['course']);
$resaddress = test_input($_POST['address']);
$password = test_input($_POST['password']);
$orig_file = $_FILES["avatar"]["tmp_name"];
$ext = pathinfo($_FILES["avatar"]["name"], PATHINFO_EXTENSION);
$target_dir = 'uploads/';
$destination = "$target_dir$contact.$ext";
move_uploaded_file($orig_file,$destination);
//Call function to insert and track if success or not
$isSuccess = $user->insertUser($fname,$lname,$dob,$username,$password,$contact,$course1,$resaddress,$destination);
if($isSuccess){
include 'includes/successmessage.php';
}
else{
include 'includes/errormessage.php';
}
}
?>
<!-- This prints out values that were passed to the action page using method="post" -->
<img src="<?php echo $destination; ?>" class="rounded-circle" style="width: 20%; height: 20%" />
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">
<?php echo $_POST['firstname'] . ' ' . $_POST['lastname']; ?>
</h5>
<p class="card-text">
Date Of Birth: <?php echo $_POST['dob']; ?>
</p>
<p class="card-text">
Email Adress: <?php echo $_POST['mail']; ?>
</p>
<p class="card-text">
Contact Number: <?php echo $_POST['phone']; ?>
</p>
</div>
</div>
<br>
<br>
<br>
<br>
<br>
<?php require_once 'includes/footer.php'; ?>