-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.php
26 lines (25 loc) · 861 Bytes
/
upload.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
<?php
$msg = " ".var_dump($_FILES)." ";
$new_image_name = $_FILES["uploaded_file"]["name"];
if(move_uploaded_file($_FILES["uploaded_file"]["tmp_name"], getcwd() . "/uploads/" . $new_image_name)){
echo "The file".basename($_FILES["uploaded_file"]["tmp_name"])." has been uploaded";
}
if(isset($_POST["value1"])){
$file = 'people.txt';
$person = "\n".$_POST["value1"]."\n";
file_put_contents($file, $person, FILE_APPEND | LOCK_EX);
echo "string assigned successfully";
}
if(isset($_POST["value2"])){
$file = 'people.txt';
$person = "\n".$_POST["value2"]."\n\n";
file_put_contents($file, $person, FILE_APPEND | LOCK_EX);
echo "string assigned successfully";
}
if(isset($_POST["value3"])){
$file = 'people.txt';
$person = "\n".$_POST["value3"]."\n\n";
file_put_contents($file, $person, FILE_APPEND | LOCK_EX);
echo "string assigned successfully";
}
?>