I'll elaborate my comment. Your ZIP file contains valid ZIP stuff plus a complete HTML document at the end. And I don't mean you've added properly compressed HTML at the end—it's simply appended:
There's no way to say how this happened from the code you've shared but it should be fairly obvious to fix once you've aware of it.
Educate guess - I suppose you have this:
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);
}
?>
<!DOCTYPE html>
<head>
...
You can for instance finish the script before running the unwanted code:
unlink($zip_name);
exit;
... or use if()
constructs to not run it:
if(file_exists($zip_name)){
// ...
}else{ ?>
<!DOCTYPE html>
<head>
<? }