-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile.php
More file actions
40 lines (38 loc) · 707 Bytes
/
file.php
File metadata and controls
40 lines (38 loc) · 707 Bytes
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
<?php
/*phpinfo();
$a = array(1,2,3,4);
$x = array_sum($a);
echo "$x";
*/
/*
echo $path = __FILE__;
echo __LINE__;
echo __DIR__;
if (is_file($path)) {
echo "Ture";
}
if (is_dir(__DIR__)) {
echo "Ture";
}
if (file_exists($path)) {
echo "Ture";
}*/
if(isset($_POST['upload'])){
$file_temp = $_FILES['file']['tmp_name'];
$file_name = $_FILES['file']['name'];
$dir = 'website';
move_uploaded_file($file_temp,$dir.'/'.$file_name);
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form method="post" enctype="multipart/form-data" action="file.php">
<input type="file" name="file" />
<input type="submit" name="upload" />
</form>
</body>
</html>