//HTML:
<form action="getCSV.php" method ="post" >
<input type="hidden" name="csv_text" id="csv_text">
<input type="submit" value="Get CSV File"
onclick="getCSVData()"
</form>
<script>
function getCSVData(){
var csv_value=$('#tableID').table2CSV({delivery:'value'});
$("#csv_text").val(csv_value);
}
</script>
//php
<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"my-data.csv\"");
$data=stripcslashes($_REQUEST['csv_text']);
echo $data;
?>
Comments
Comments are not available for this entry.