Guest User

Untitled

a guest
Feb 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. if (file_exists('./img'))
  2. foreach (glob('./img/*') as $file)
  3. unlink($file);
  4. echo("Файлы каталога успешно удалены, обновите страницу");
  5.  
  6. if (file_exists('./img')) {
  7.  
  8. foreach (glob('./img/*') as $file)
  9. {
  10. if ($file!='.htaccess') unlink($file);
  11. }
  12.  
  13. echo("Файлы каталога успешно удалены, обновите страницу");
  14.  
  15. }
  16.  
  17. if (file_exists('./img/mini_logo')) {
  18. include('db.php');
  19. $query = 'SELECT img FROM zayav';
  20. $res = mysql_query( $query );
  21. $img = array();
  22. while ( $item = mysql_fetch_array($res)) {
  23. $img3 = $item['img'];
  24. $way="./img/mini_logo/$img3.png";
  25. $img[] = $way;
  26. }
  27. foreach (glob('./img/mini_logo/*') as $file)
  28. {
  29. if( !in_array( $file, $img)) unlink($file);
  30. }
  31. echo "<script>history.go(-1);alert( 'Все ненужные файлы очищены!');</script>";
  32. }
Add Comment
Please, Sign In to add comment