Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- ob_start( 'ob_gzhandler' );
- $user = $_SESSION['username'];
- $pass = $_SESSION['password'];
- $email = $_SESSION['email'];
- $first = $_SESSION['first'];
- $last = $_SESSION['last'];
- $email = $_SESSION['email'];
- $serialNumber = $_SESSION['serialNumber'];
- $boardType = $_SESSION['boardType'];
- $boardStyle = $_SESSION['boardStyle'];
- $referredby = $_SESSION['referredby'];
- $vipLevel_id = $_SESSION['vipLevel_id'];
- $vipExpirationDate = $_SESSION['vipExpirationDate'];
- $expired = $_SESSION['expired'];
- $created_at = $_SESSION['created_at'];
- $updated_at = $_SESSION['updated_at'];
- if (!isset($serialNumber) && !isset($user)){
- header( "Location: login.html" );
- }
- ?>
- <?php
- /*
- Website: https://www.thepiwizard.com/
- */
- ?>
- <?php
- if(isset($_POST['roms']))
- {
- $error = "";
- if(isset($_POST['createzip']))
- {
- $post = $_POST;
- $file_folder = "roms/nes/"; // folder to load files
- if(extension_loaded('zip'))
- {
- // Checking ZIP extension is available
- if(isset($post['roms']) and count($post['roms']) > 0)
- {
- // Checking files are selected
- $zip = new ZipArchive(); // Load zip library
- $zip_name = $serialNumber.".zip"; // Zip name
- if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE)
- {
- // Opening zip file to load files
- $error .= "* Sorry ZIP creation failed at this time";
- }
- foreach($post['roms'] as $file)
- {
- $zip->addFile($file_folder.$file); // Adding files into zip
- }
- $zip->close();
- if(file_exists($zip_name))
- {
- // push to download the zip
- //header('Content-type: application/zip');
- //header('Content-Disposition: attachment; filename="'.$zip_name.'"');
- //readfile($zip_name);
- // remove zip file is exists in temp path
- // unlink($zip_name);
- }
- }
- else
- $error .= "* Please select file to zip ";
- }
- else
- $error .= "* You dont have ZIP extension";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement