You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
376 B
PHTML
15 lines
376 B
PHTML
1 year ago
|
|
||
|
<?php
|
||
|
|
||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||
|
|
||
|
$uploaddir = getcwd() . '/uploads/';
|
||
|
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
|
||
|
|
||
|
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
|
||
|
echo "File is valid, and was successfully uploaded.\n";
|
||
|
} else {
|
||
|
echo "Possible file upload attack!\n";
|
||
|
}
|
||
|
}
|
||
|
?>
|