I have a php file called "list.php" that displays a list of all tenders and allows the Administrator to filter the tenders based on 3 select drop downs (status, type and year).
I have code inside here that writes these filtered results to a file called "tenders.csv". This file is re-created each time a new filter selection is made.
At the bottom of my page I have added an href with a link to my "download.php" page which forces the download of this file.
When I click the href on the "list.php" page, a pop up box displays with the options of Open with or Save File. The file isn't my tenders.csv file though, it's a php file (see attached screenshot).
Not sure how to fix this.
Here is the href in the "list.php" file.
Code: Select all
<?php $stmp1 = WP_PLUGIN_URL . TENDER_FOLDER . "/download.php"; ?> <a href="<?php echo $stmp1; ?>">Download CSV</a>