I have an issue. I have an index.php with several checkboxes. Every checkbox represents a piece of code. I am trying to create some generating tool. For example: if I select four checkboxes, I want that four specific parts of code to generate in one php file, then zip it and download on my computer.
I know I can do it something like this:
$files = array('list.php', 'one-image.php', 'gallery.php', 'pdf.php');
$zipname = 'file.zip';
$zip = new ZipArchive;
$zip->open($zipname, ZipArchive::CREATE);
foreach ($files as $file) {
$zip->addFile($file);
}
$zip->close();
header('Content-Type: application/zip');
header('Content-disposition: attachment; filename='.$zipname);
header('Content-Length: ' . filesize($zipname));
readfile($zipname);
but, at the moment i am pretty lost. Thanks in advance.