Advertisement
Guest User

Untitled

a guest
Oct 30th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. <?php
  2. include('../../logowanie.php');
  3. function tabele()
  4. {
  5. GLOBAL $polaczenie;
  6. $tabele='';
  7. $sql="SHOW TABLES;";
  8. $sql = mysqli_query($polaczenie, $sql);
  9. $licz =1;
  10. while($tab=mysqli_fetch_array($sql))
  11. {
  12. $tabele.= $tab[0].'<input type="checkbox" value="'.$tab[0].'" name="ch'.$licz.'"><br>';
  13. $licz++;
  14. }
  15.  
  16. $tabele.='<input type="hidden" name="licz" value="'.$licz.'">';
  17. return $tabele;
  18. }
  19. function pokaz()
  20. {
  21. $wiersze=file($_GET['p']);
  22. $w='';
  23. foreach($wiersze as $wiersz)
  24. {
  25. $w.=$wiersz;
  26. }
  27. return $w;
  28. }
  29. if(isset($_POST['submit']))
  30. {
  31. $tabele='';
  32. $data =date('Y-m-d_H:i:s');
  33. $akcja=$_POST['akcja'];
  34. $licz = $_POST['licz'];
  35. for($i = 1; $i<$licz; $i++)
  36. {
  37. $tabele.= @$_POST['ch'.$i].' ';
  38. }
  39. //echo $tabele.' '.$akcja;
  40. echo (`mysqlcheck --check zsp1_patrykd $tabele --user=$login --password=$haslo`);
  41. echo '<hr>';
  42. echo(`mysqldump --user=$login --password=$haslo zsp1_patrykd $tabele $akcja > kopia_$data.sql`);
  43. }
  44. if(isset($_GET['u']))
  45. {
  46. unlink($_GET['u']);
  47. }
  48. ?>
  49. <html>
  50. <head>
  51.  
  52. </head>
  53. <body>
  54. <form method="POST">
  55. <?php
  56. echo tabele();
  57. ?>
  58. <select name="akcja">
  59. <option value="">Wszystkie</option>
  60. <option value="--no-create-info">--no-create-info</option>
  61. <option value="--no-date">--no-date</option>
  62. </select>
  63. <input type="submit" name="submit" value="KOPIA">
  64. </form>
  65. <?php
  66. $katalog='./';
  67. $plik=scandir($katalog,1);
  68. foreach($plik as $plik)
  69. {
  70. if($plik!='.' AND $plik != '..' AND $plik != 'index.php')
  71. {
  72. echo '<a href="?p='.$plik.'">'.$plik.'</a> |<a href="?u='.$plik.'">U</a>|'.filesize($plik).' b<br>';
  73. }
  74.  
  75. }
  76. if(isset($_GET['p']))
  77. {
  78. echo '<textarea style="width:100%;height:500px;">';
  79. echo pokaz();
  80. echo '</textarea>';
  81. }
  82. ?>
  83. <body>
  84.  
  85. </body>
  86. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement