Skip to content

Instantly share code, notes, and snippets.

@AtenosFox
Created December 15, 2018 20:41
Show Gist options
  • Save AtenosFox/a4cf96bab8704c4d4e45bd40c0a74757 to your computer and use it in GitHub Desktop.
Save AtenosFox/a4cf96bab8704c4d4e45bd40c0a74757 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>chat</title>
</head>
<body>
<form method="post" class="menu">
<div class="menu">
<input type="text" name="creator" style="width: 170px">
<input type="text" name="header" style="width: 170px">
<input type="text" name="text" style="width: 170px">
<input type="submit" style="width: 85px">
</div>
</form>
<?php
if (isset($_POST['creator']) && isset($_POST['header']) && isset($_POST['text'])) {
$file = fopen('content.txt', 'w+');
$creator = $_POST['creator'];
$header = $_POST['header'];
$text = $_POST['text'];
/* fwrite($file, $creator . '|' . $header . '|' . $text . "\n");
fclose($file);*/
fwrite($file, $creator . "\n" . $header . "\n" . $text . "\n");
$message = file("content.txt");
echo "<pre>";
print_r($message);
echo "</pre>";
}
?>
<div class="post" style="position: absolute; top: <?= $position; ?>; background-color: green; width: 300px; height: 200px"></div>
<style type="text/css">
.menu {
background-color: cornflowerblue;
position: fixed;
height: 50px;
top: 600px;
width: 620px;
left: 30%;
right: 50%;
}
</style>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment