mirror of
https://github.com/ctxis/beemka
synced 2026-06-08 13:38:25 +00:00
37 lines
744 B
PHP
37 lines
744 B
PHP
<?php
|
|
$storage = '/tmp/beemka-text.txt';
|
|
$paramName = 'data';
|
|
|
|
// Try to create file.
|
|
@touch($storage);
|
|
if (!file_exists($storage)) {
|
|
die('Could not create storage file: ' . $storage);
|
|
} elseif (!is_writable($storage)) {
|
|
die($storage . ' is not writable.');
|
|
}
|
|
|
|
$data = isset($_REQUEST[$paramName]) ? trim($_REQUEST[$paramName]) : '';
|
|
if (!empty($data)) {
|
|
file_put_contents($storage, $data, FILE_APPEND);
|
|
die();
|
|
}
|
|
|
|
$data = file_get_contents($storage);
|
|
?>
|
|
<html>
|
|
<head>
|
|
</head>
|
|
<body>
|
|
<pre><?php echo $data; ?></pre>
|
|
|
|
<script type="text/javascript">
|
|
setInterval(
|
|
function() {
|
|
location.reload();
|
|
},
|
|
1000
|
|
);
|
|
</script>
|
|
</body>
|
|
</html>
|