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.
58 lines
1.5 KiB
PHTML
58 lines
1.5 KiB
PHTML
1 year ago
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<title>Upload to the archive</title>
|
||
|
<link rel="stylesheet" href="style.css">
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<?php echo "aaa";
|
||
|
var_dump(getcwd()); ?>
|
||
|
<div class="container recorder">
|
||
|
|
||
|
<article>
|
||
|
<h1>Signal lost archive unzipped</h1>
|
||
|
<p>some info on what this even is</p>
|
||
|
</article>
|
||
|
<div class="button__wrapper"><button class='fn-start-recording button--record'>
|
||
|
<span class="button__label">RECORD</span>
|
||
|
</button>
|
||
|
|
||
|
<a href="" class="fn-file-upload">Upload a file instead</a>
|
||
|
</div>
|
||
|
<div></div>
|
||
|
<audio controls></audio>
|
||
|
</div>
|
||
|
|
||
|
<section class='upload'>
|
||
|
|
||
|
<form enctype="multipart/form-data" class="fn-upload-form" action="upload.php" method="POST">
|
||
|
|
||
|
<input name="userfile" type="file" />
|
||
|
<input type="submit" value="Send File" />
|
||
|
</form>
|
||
|
</section>
|
||
|
|
||
|
|
||
|
<script type="text/javascript" src="script.js"></script>
|
||
|
</body>
|
||
|
|
||
|
</html>
|
||
|
|
||
|
<?php
|
||
|
|
||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||
|
|
||
|
$uploaddir = '/opt/homebrew/var/www/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";
|
||
|
}
|
||
|
}
|
||
|
?>
|