Posted By

smilylion on 09/13/06


Tagged

delete


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


delete lines in file checkboxes


 / Published in: PHP
 

  1. #Datenverarbeitung
  2. if (isset($HTTP_POST_VARS['delete'])) {
  3. $inhalt = file('_matrix2.php');
  4. $fp = fopen('_matrix2.php','w');
  5. flock($fp,2);
  6. while (list($inhalt_key,$inhalt_val) = each($inhalt)) {
  7. if (!isset($HTTP_POST_VARS['delete'.$inhalt_key])) {
  8. fwrite($fp,$inhalt_val);
  9. }
  10. }
  11. flock($fp,3);
  12. fclose($fp);
  13. }
  14. #ENDE: Datenverarbeitung
  15.  
  16. #Datenausgabe
  17. $inhalt = file('_matrix2.php');
  18.  
  19. echo '<form method="post" action="'.$HTTP_SERVER_VARS['PHP_SELF'].'">';
  20. while (list($inhalt_key,$inhalt_val) = each($inhalt)) {
  21. echo $inhalt_val.'<input type="checkbox" name="delete'.$inhalt_key.'"><br>';
  22. }
  23. echo '<input type="submit" name="delete"></form>';
  24. #ENDE: Datenausgabe

Report this snippet  

You need to login to post a comment.