<? include ("../settings.php"); ?>
<? include("session.php"); ?>
<?

    $zip = new ZipArchive;
	$zip->open('zip/student.zip', ZipArchive::CREATE);
	foreach (glob("../register/student/*") as $file) {
		$zip->addFile($file);
	}
	$zip->close();

	$file = "zip/student.zip";
	
     // Set headers
     header("Cache-Control: public");
     header("Content-Description: File Transfer");
     header("Content-Disposition: attachment; filename=student.zip");
     header("Content-Type: application/zip");
     header("Content-Transfer-Encoding: binary");

     // Read the file from disk
     readfile($file);

?>