Add farp.php
This commit is contained in:
parent
1fb9a966dd
commit
d1abd019a7
1 changed files with 34 additions and 0 deletions
34
farp.php
Normal file
34
farp.php
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<php?
|
||||||
|
$myfile = fopen("posts.txt", "r") or die("Unable to open file!");
|
||||||
|
$content = fread($myfile, filesize("posts.txt"));
|
||||||
|
fclose($myfile);
|
||||||
|
|
||||||
|
// write new post to file if necessary
|
||||||
|
if (!is_null($_POST["body"]) && strlen($_POST["body"]) != 0) {
|
||||||
|
// 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 = "<div class='post'><h2>" . $signature . "</h2><i>UTC " . date("Y/m/d H:i") . "</i><div>" . htmlspecialchars($_POST["body"]) . "</div></div>" . $content;
|
||||||
|
|
||||||
|
// write string back into the file
|
||||||
|
$myfile = fopen("posts.txt", "w") or die("Unable to open file!");
|
||||||
|
fwrite($myfile, $content);
|
||||||
|
fclose($myfile);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
window.location.href = 'https://furp.colean.cc';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
Reference in a new issue