I have this piece of code here:
[php]<?php
// output headers so that the file is downloaded rather than displayed
header(‘Content-Type: text/csv; charset=utf-8’);
header(‘Content-Disposition: attachment; filename=data.csv’);
// create a file pointer connected to the output stream
$output = fopen(‘php://output’, ‘w’);
// output the column headings
#fputcsv($output, array(‘Column 1’, ‘Column 2’, ‘Column 3’));
// fetch the data
mysql_connect(‘localhost’, ‘erlendanderson’, ‘ugumuq’);
mysql_select_db(‘nooruse’);
$rows = mysql_query(‘SELECT osakond, soetusaasta, it_number, tooteruhm, mudeli_nimetus, sn, riigivara_nr, inventaari_nr, maja, ruum, vastutaja, markus FROM norse5_proov’);
// loop over the rows, outputting them
while ($row = mysql_fetch_assoc($rows)) fputcsv($output, $row);
?>[/php]
I would like it to ask a download window so I can download the file automatically w/o having to copy-paste stuff.
How can I do that? thanks in advance