I have a link / button on my page that should lead the user to the csv file. A csv file is generated dynamically using PHP based on some POST variables:
<?php
header("Content-type: application/csv");
header("Content-Disposition: attachment; filename=e".date('ymdHis').".csv");
...
?>
How can I redirect to a script while passing POST variables without using a form?
Answers I found that I do not really like this:
- Create a hidden POST form with the required variables and call the message using javascript
- Use jQuery.post to load the page - I still don't see how I can use jQuery or AJAX at all to redirect the page
source
share