I am trying to create a button that will force a CSV file download but for some reason I am not able to get it working. This is the code that I have:
public
you need to echo your content after the header
echo
header('Content-Description: File Transfer'); header('Content-Type: application/force-download'); header('Content-Disposition: attachment; filename=pedidos.csv'); echo $shtml