-
Notifications
You must be signed in to change notification settings - Fork 0
/
requesterCheck.php
45 lines (34 loc) · 1.16 KB
/
requesterCheck.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
<?php
$fullName = $_POST['fullName'];
$username = $_POST['username'];
$serialNo = $_POST['serialNo'];
$requestingAmount = $_POST['requestingAmount'];
if(isset($_POST['requestNow'])){
if($fullName != null && $username != null && $serialNo != null && $requestingAmount != null){
$request = $fullName."|".$username."|".$serialNo."|".$requestingAmount."\r\n";
$requestFile=fopen('../LogIn/uploads/requests.txt', 'a');
fwrite($requestFile, $request);
fclose($requestFile);
$_SESSION['documentUsername'] = $username;
$_SESSION['documentSerialNo'] = $serialNo;
header('location: requester.php');
}
else{
header('location: requester.php?err=empty');
}
}
else if(isset($_POST['upload'])){
// // File upload start
// echo "<pre>";
// print_r($_FILES);
$src = $_FILES['myfile']['tmp_name'];
$des ="../LogIn/uploads/documents".$_FILES['myfile']['name'];
if(move_uploaded_file($src, $des)){
echo "Success";
header('location: requester.php');
}else{
echo "Error";
}
// File upload end
}
?>