This repository has been archived on 2024-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
furpsocial/index.php

57 lines
1.7 KiB
PHP
Raw Normal View History

2023-08-01 19:57:14 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<title>furpSocial</title>
<meta charset="UTF-8">
<style>
:root {
--accent: #32a852;
}
2023-08-01 19:38:07 +01:00
2023-08-01 19:57:14 +01:00
body {
2023-08-01 20:39:25 +01:00
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
2023-08-01 19:57:14 +01:00
background: var(--accent);
margin: 0;
padding: 0;
}
2023-08-01 20:11:48 +01:00
2023-08-01 20:13:44 +01:00
#body-input {
2023-08-01 20:43:22 +01:00
width: 99%;
2023-08-01 20:13:44 +01:00
height: 150px;
2023-08-01 20:43:22 +01:00
resize: none;
2023-08-01 20:13:44 +01:00
}
2023-08-01 19:57:14 +01:00
</style>
</head>
<body>
2023-08-01 20:06:27 +01:00
<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;">
2023-08-01 19:57:14 +01:00
<h1 style="margin: 0; font-size: 20px;"><span style="color: var(--accent);">furp</span>social</h1>
<hr>
2023-08-01 19:38:07 +01:00
2023-08-01 20:14:40 +01:00
<form method="post">
2023-08-01 20:18:09 +01:00
<textarea id="body-input" name="body"></textarea>
2023-08-01 20:39:25 +01:00
Signature (optional): <input type="text" name="signature"><br>
2023-08-01 19:57:14 +01:00
<input type="submit">
</form>
2023-08-01 19:38:07 +01:00
2023-08-01 20:25:30 +01:00
<hr>
2023-08-01 20:45:12 +01:00
2023-08-01 22:01:43 +01:00
<?php
2023-08-01 22:14:53 +01:00
// write to file
2023-08-01 22:22:24 +01:00
if (!is_null($_POST["body"])) {
2023-08-01 22:22:34 +01:00
$myfile = fopen("posts.txt", "a") or die("Unable to open file! (a)");
fwrite($myfile, $_POST["signature"] . ": " . $_POST["body"] . "<br>");
fclose($myfile);
2023-08-01 22:22:24 +01:00
}
2023-08-01 22:14:53 +01:00
// read from file
2023-08-01 22:15:19 +01:00
$myfile = fopen("posts.txt", "r") or die("Unable to open file! (r)");
2023-08-01 22:03:44 +01:00
echo fread($myfile,filesize("posts.txt"));
2023-08-01 22:01:43 +01:00
fclose($myfile);
?>
2023-08-01 20:25:30 +01:00
2023-08-01 19:57:14 +01:00
</div>
</body>
2023-08-01 19:38:07 +01:00
</html>