32 lines
No EOL
1.1 KiB
PHP
32 lines
No EOL
1.1 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<link rel="stylesheet" href="style.css">
|
|
</head>
|
|
<body onload="window.location.href = 'https://furp.colean.cc';">
|
|
|
|
<?php
|
|
// write new post to file only if necessary
|
|
if (!is_null($_POST["image-bits"]) && strlen($_POST["image-bits"]) != 0) {
|
|
$myfile = fopen("posts.txt", "r") or die("Unable to read file!");
|
|
$content = fread($myfile, filesize("posts.txt"));
|
|
fclose($myfile);
|
|
|
|
// concatenate new post to the beginning of the string
|
|
$signature = "anonymous";
|
|
if (!is_null($_POST["signature"]) && strlen($_POST["signature"]) != 0) {
|
|
$signature = htmlspecialchars($_POST["signature"]);
|
|
}
|
|
$content = $signature . "<br>UTC " . date("Y/m/d H:i") . "<br>" . htmlspecialchars($_POST["image-bits"]) . "<br>" . $content;
|
|
|
|
// write string back into the file
|
|
$myfile = fopen("posts.txt", "w") or die("Unable to write file!");
|
|
fwrite($myfile, $content);
|
|
fclose($myfile);
|
|
} else {
|
|
echo '<script>alert("Please draw something.")</script>';
|
|
}
|
|
?>
|
|
|
|
</body>
|
|
</html>
|