Advertisement
AndreyKlipikov

Easy FileBD

Feb 21st, 2014
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.87 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <meta charset="utf-8">
  5.         <title>Список исключаемых вопросов дня</title>
  6.     </head>
  7.     <body>
  8.         <div style="width:500px;margin:0 auto">
  9.             <?php
  10.                 if (isset($_POST['file']) && isset($_POST['password'])) {
  11.                     if (md5($_POST['password']) == "md5_hash") {
  12.                         file_put_contents("bd.dat", base64_encode($_POST['file']));
  13.                         echo "      <h1>Вопросы успешно сохранены.</h1>" . PHP_EOL;
  14.                     }
  15.                 }
  16.                 $file = base64_decode(file_get_contents("bd.dat"));
  17.             ?>
  18.             <form method="post" action="">
  19.                 <h2>Вопросы:</h2>
  20.                 <textarea name="file" style="width:99%;height:200px"><?=$file?></textarea>
  21.                 <h2>Пароль:</h2>
  22.                 <input type="password" name="password" value="">
  23.                 <hr>
  24.                 <input type="submit" value="Сохранить">
  25.             </form>
  26.         </div>
  27.     </body>
  28. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement