Hallo Leute!
Ich bin absoluter php-Anfänger und hab mir da mal 2 kleine Scripte zusammen gebastelt.
Jetzt wollte ich fragen, wie kann ich das zu einem Script kombinieren?
	
Vielen Dank im voraus,
mfg. Zerosurf
					Ich bin absoluter php-Anfänger und hab mir da mal 2 kleine Scripte zusammen gebastelt.
Jetzt wollte ich fragen, wie kann ich das zu einem Script kombinieren?
PHP-Code:
	
	
1. Script:
<?php
echo '<center><p><b>Select Archive to extract in the current directory:</b></p>';
echo '<form action="extract.php" method="post"><select name="archive">';
if ($handle = opendir('.')) {
    while (false !== ($file = readdir($handle))) {
        if (preg_match("/\.zip$/i", $file)) {
            echo '<option>'.$file.'</option>';
        }
    }
echo '<input type="submit" value="Unzip">';
echo '</select></form></center>';
    closedir($handle);
}
?>
2. Script:
<?php
  require_once('pclzip.lib.php');
  $archive = new PclZip($_POST['archive']);
  if ($archive->extract() == 0) {
    die("Error : ".$archive->errorInfo(true));
  }
echo "<center><p><u>Zip Archive - <b>".$_POST['archive']."</b> - successfully extracted!</u></p><input type='button' value='Back' onclick='history.go(-1); return false;'></center>";
?>
mfg. Zerosurf
          
Kommentar