Hey ignace, thanks for the reply.
I have now got my functions firing off of a button press, so thanks for that.
I'm still suffering from a lack of understanding about the other part though - First thing I do when the button is pressed is run a script that creates a temporary file on my server, and that works fine. Next I'm trying to use the help you provided to force the download of that data, and I have created a new file and placed the headers with correct names etc in the there, but when that file is called I get to following error -
index_users.php is where I'm trying to control this from, and download_tempData-csv.php is where I placed the headers (and nothing else, just the headers.). I'd very much appriciate it if you were able to help further.
Thanks.