Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form method='post'>
- <?php
- $file = file('list.txt');
- if(!empty($_POST))
- {
- file_put_contents('list.txt', '');
- foreach($file as $key => $value) {
- if(!isset($_POST['s'.$key])) {
- //unset($_POST['s'],$key);
- $mol = [$key => $value];
- foreach($mol as $v) {
- file_put_contents('list.txt', $v, FILE_APPEND);
- }
- }
- }
- $file = file('list.txt');
- foreach($file as $key => $value) {
- echo "<input type='checkbox' name='s".$key."' value={$key}>{$value}<br/>";
- }
- } else {
- foreach($file as $key => $value) {
- echo "<input type='checkbox' name='s".$key."' value={$key}>{$value}<br/>";
- }
- }
- ?>
- <input type='submit' value='send'/>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement