Guest User

Untitled

a guest
Jul 4th, 2021
47
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <form method='post'>
  2. <?php
  3. $file = file('list.txt');
  4. if(!empty($_POST))
  5. {
  6.    file_put_contents('list.txt', '');
  7.    foreach($file as $key => $value) {
  8.         if(!isset($_POST['s'.$key])) {
  9.             //unset($_POST['s'],$key);
  10.             $mol = [$key => $value];
  11.             foreach($mol as $v) {
  12.                 file_put_contents('list.txt', $v, FILE_APPEND);
  13.             }
  14.         }
  15.     }
  16.     $file = file('list.txt');
  17.     foreach($file as $key => $value) {
  18.         echo "<input type='checkbox' name='s".$key."' value={$key}>{$value}<br/>";
  19.     }
  20. } else {
  21.     foreach($file as $key => $value) {
  22.         echo "<input type='checkbox' name='s".$key."' value={$key}>{$value}<br/>";
  23.     }
  24. }
  25. ?>
  26. <input type='submit' value='send'/>
  27. </form>
RAW Paste Data