Advertisement
Guest User

Untitled

a guest
Nov 25th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5. ob_start( 'ob_gzhandler' );
  6.  
  7. $user = $_SESSION['username'];
  8.  
  9. $pass = $_SESSION['password'];
  10.  
  11. $email = $_SESSION['email'];
  12.  
  13. $first = $_SESSION['first'];
  14.  
  15. $last = $_SESSION['last'];
  16.  
  17. $email = $_SESSION['email'];
  18.  
  19. $serialNumber = $_SESSION['serialNumber'];
  20.  
  21. $boardType = $_SESSION['boardType'];
  22.  
  23. $boardStyle = $_SESSION['boardStyle'];
  24.  
  25. $referredby = $_SESSION['referredby'];
  26.  
  27. $vipLevel_id = $_SESSION['vipLevel_id'];
  28.  
  29. $vipExpirationDate = $_SESSION['vipExpirationDate'];
  30.  
  31. $expired = $_SESSION['expired'];
  32.  
  33. $created_at = $_SESSION['created_at'];
  34.  
  35. $updated_at = $_SESSION['updated_at'];
  36.  
  37. if (!isset($serialNumber) && !isset($user)){
  38.  
  39. header( "Location: login.html" );
  40.  
  41. }
  42.  
  43. ?>
  44. <?php
  45. /*
  46. Website: https://www.thepiwizard.com/
  47. */
  48. ?>
  49. <?php
  50. if(isset($_POST['roms']))
  51. {
  52. $error = "";
  53. if(isset($_POST['createzip']))
  54. {
  55. $post = $_POST;
  56. $file_folder = "roms/nes/"; // folder to load files
  57. if(extension_loaded('zip'))
  58. {
  59. // Checking ZIP extension is available
  60. if(isset($post['roms']) and count($post['roms']) > 0)
  61. {
  62. // Checking files are selected
  63. $zip = new ZipArchive(); // Load zip library
  64. $zip_name = $serialNumber.".zip"; // Zip name
  65. if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE)
  66. {
  67. // Opening zip file to load files
  68. $error .= "* Sorry ZIP creation failed at this time";
  69. }
  70. foreach($post['roms'] as $file)
  71. {
  72. $zip->addFile($file_folder.$file); // Adding files into zip
  73. }
  74. $zip->close();
  75. if(file_exists($zip_name))
  76. {
  77. // push to download the zip
  78. //header('Content-type: application/zip');
  79. //header('Content-Disposition: attachment; filename="'.$zip_name.'"');
  80. //readfile($zip_name);
  81. // remove zip file is exists in temp path
  82. // unlink($zip_name);
  83. }
  84.  
  85. }
  86. else
  87. $error .= "* Please select file to zip ";
  88. }
  89. else
  90. $error .= "* You dont have ZIP extension";
  91. }
  92. }
  93. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement