Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php
- $resdir = '/var/www/html/res/';
- if (!file_exists($resdir) ) {
- mkdir ($resdir, 0744);
- }
- $slogans = array("Literally the best.", "Airship.moe 2.0", "Jingly as Fuck.");
- $actSlogan = $slogans[array_rand($slogans)];
- ?>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Marzana.tk</title>
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <body>
- <h1>Marzana.tk</h1>
- <h2> - <?php echo $actSlogan;?></h2>
- <div id="text">
- <?php
- $txtfile;
- if($_POST['posttxt'] == '!CLEAR') {
- unlink($resdir . 'text.txt');
- }
- elseif(isset($_POST['posttxt'])) {
- if(!$txtfile = fopen($resdir . 'text.txt', 'a+')) {
- echo 'File write open error.<br />';
- }
- if(!fwrite($txtfile, str_replace(PHP_EOL, '<br />', htmlspecialchars($_POST['posttxt'])) . PHP_EOL)) {
- echo 'File write error.<br />';
- }
- fclose($txtfile);
- }
- if(!$txtfile = fopen($resdir . 'text.txt', 'r')) {
- echo '<span style="color: #cccccc;">Nothing here.</span><br />';
- }
- while ($line = fgets($txtfile)) {
- echo '<div class="line">' . $line . '</div>' . PHP_EOL;
- }
- fclose($txtfile);
- ?>
- </div>
- <br /><br />
- <form type="text/multipart" method="post">
- <textarea id="posttxt" name="posttxt" cols="80" rows="10""></textarea>
- <br />
- <br />
- <input type="submit" value="Post" />
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement