Thread Starter
i5513
(@i5513)
The problem is that we are using php 5.2,
Can you support php 5.2 (minimum requisite for wordpress)? In this case I had to change your cf7AdbExportController code to no use anonymous functions:
Modifying cf7_adb.class.php :
function empty_function () {
}
function add_header_function() {
$id= $_GET['id'];
$filename = "contact_form_advanced_database_" . date('Ymd') . ".csv";
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-Type: application/vnd.ms-excel");
require_once('display/export.php');
exit;
}
function cf7AdbExportController() {
// filename for download\
// $hook = add_submenu_page(null, '', '', 'administrator', 'cf7-adb-export-xls', function(){});
$hook = add_submenu_page(null, '', '', 'administrator', 'cf7-adb-export-xls', 'empty_function');
add_action('load-' . $hook, 'add_header_function' );
}
Thank you very much
Hi i5513,
Sorry for not fixing this ASAP I got really busy these pass few months.
Thanks for the code I will check this and apply it on the plugin to support php 5.2 version.
Thank you so much for the help!!
I’m getting a “You do not have sufficient permissions to access this page.” error with the code from i5513 when I try to export.
Hi xCD7x,
Hmmm, it is working fine on my end. What version of wordpress are you using? Please update it to 1.0.6 and let me know if the issue is still there.
Thank you!