65 lines
No EOL
2.3 KiB
PHP
65 lines
No EOL
2.3 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>furpsocial</title>
|
|
<meta charset="UTF-8">
|
|
<style>
|
|
:root {
|
|
--accent: #32a852;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
|
|
background: var(--accent);
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
#body-input {
|
|
width: 99%;
|
|
height: 150px;
|
|
resize: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div style="width: 100%; max-width: 600px; background: white; height: 100vh; margin: auto; padding: 10px; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-shadow: 0px 0px 10px gray;">
|
|
<h1 style="margin: 0; font-size: 20px;"><span style="color: var(--accent);">furp</span>social</h1>
|
|
|
|
<hr>
|
|
|
|
<form method="post">
|
|
<textarea id="body-input" name="body"></textarea>
|
|
Signature (optional): <input type="text" name="signature"><br>
|
|
<input type="submit">
|
|
</form>
|
|
|
|
<span style="font-size: 12px; color: grey;">The only data collected by furp is the contents of your posts (signature and message). This information is stored in our secure databases for as long as I feel like it. It is only used to accomodate furp as a social media platform.</span>
|
|
|
|
<hr>
|
|
|
|
<?php
|
|
// write to file
|
|
if (!is_null($_POST["body"]) && strlen($_POST["body"]) != 0) {
|
|
$myfile = fopen("posts.txt", "a") or die("Unable to open file! (a)");
|
|
|
|
if (!is_null($_POST["signature"]) && strlen($_POST["signature"]) != 0) {
|
|
fwrite($myfile, htmlspecialchars($_POST["signature"]) . ": " . htmlspecialchars($_POST["body"]) . "<br>");
|
|
} else {
|
|
fwrite($myfile, "anon: " . htmlspecialchars($_POST["body"]) . "<br>");
|
|
}
|
|
|
|
fclose($myfile);
|
|
}
|
|
|
|
// read from file
|
|
$myfile = fopen("posts.txt", "r") or die("Unable to open file! (r)");
|
|
echo fread($myfile,filesize("posts.txt"));
|
|
fclose($myfile);
|
|
?>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|