-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
39 lines (33 loc) · 1.14 KB
/
Copy pathprocess.php
File metadata and controls
39 lines (33 loc) · 1.14 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
<?php
// Start session to pass data between pages
session_start();
// Capture form data
$_SESSION['fullName'] = $_POST['fullName'];
$_SESSION['email'] = $_POST['email'];
$_SESSION['phone'] = $_POST['phone'];
$_SESSION['gender'] = $_POST['gender'];
$_SESSION['affiliation'] = $_POST['affiliation'];
$_SESSION['workshops'] = $_POST['workshops'];
$_SESSION['meal'] = $_POST['meal'];
$_SESSION['paymentMethod'] = $_POST['paymentMethod'];
// If a file was uploaded, store the file information
if (isset($_FILES['document'])) {
$fileName = $_FILES['document']['name'];
$fileTmpName = $_FILES['document']['tmp_name'];
$uploadDir = 'uploads/';
$filePath = $uploadDir . basename($fileName);
// Check if upload directory exists, if not, create it
if (!is_dir($uploadDir)) {
mkdir($uploadDir, 0777, true);
}
// Move the uploaded file to the uploads directory
move_uploaded_file($fileTmpName, $filePath);
// Store file path in the session
$_SESSION['document'] = $filePath;
} else {
$_SESSION['document'] = 'No file uploaded';
}
// Redirect to confirmation page
header('Location: confirmation.php');
exit();
?>