Either that, or a method for the button to open the script which creates the .csv and then to refresh the iframe which it would then be in.
Code: Select all
<tr><td><div align="center">
<button type="submit" name='View'
onclick="window.open('<? echo $_SERVER['PHP_SELF'] ."/Suppliers.php" ?>','mywindow','width=400,height=200');
window.setTimeout(function(){location.reload(true);}, 20);">
BUTTON</button>
</div></td></tr>Code: Select all
header('Content-type: text/csv');
header('Content-Disposition: attachment; filename="'.$_SESSION['CCODE'].'-Suppliers.csv"');