Advertisement
nil_007

unzipper

Jul 26th, 2018
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.02 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-UK">
  3.     <head>
  4.         <title>Billy's Unzipper Script</title>
  5.         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6.         <meta name="generator" content="thekid" />
  7.         <meta name='robots' content='noindex,nofollow' />
  8.     </head>
  9.     <body>
  10.         <?php
  11.             $file = $_GET['file'];
  12.             $removeorig = $_GET['removeorig'];
  13.             $unzipper = $_GET['unzipper'];
  14.             if (isset($file))
  15.             {
  16.                 echo "Unzipping " . $file . "...<br />\n";
  17.                 system('unzip -o ' . $file);
  18.                 echo "<hr />\n";
  19.                 if (isset($removeorig)) {
  20.                     echo "Deleting Zip...<br />\n";
  21.                     unlink("$file");
  22.                 }
  23.             }
  24.             if (isset($unzipper)) {
  25.                 echo "Deleting Script...<br />\n";
  26.                 unlink(__FILE__);
  27.                 echo "Script Deleted!<br /><a href=\"/\">HOME</a>\n";
  28.                 exit;
  29.             }
  30.             $handler = opendir(".");
  31.             echo "Please choose a file to unzip: <br />\n";
  32.             echo '<form action="" method="get">'."\n";
  33.             $found = 0;
  34.             while ($file = readdir($handler))
  35.             {
  36.                      if(strrchr($file,".zip") != ".zip" ) { continue; }
  37.                 {
  38.                     echo '<input type="radio" name="file" value="' . $file . '"/> ' . $file . "<br />\n";
  39.                     $found = 1;
  40.                 }
  41.             }
  42.             echo '<hr/><input type="checkbox" name="removeorig" value="Remove" />Delete .zip after extraction?'."<br />\n";
  43.             echo '<input type="checkbox" name="unzipper" value="Remove" checked="checked" />Delete Unzipper Script? (Uncheck this box if you have more files to unzip!)'."<br />\n";
  44.             closedir($handler);
  45.             if ($found == FALSE)
  46.                 echo "No .zips found<br />";
  47.             else
  48.                 echo '<br />NOTE: This unzips and <strong>REPLACES</strong> files.<br /><br /><input type="submit" value="Unzip!" />';
  49.        
  50.             echo "\n</form>";
  51.         ?>
  52.         <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a></p>
  53.     </body>
  54. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement