function admin_menu_function() { //variable that holds the path to the excel sheet $xlsPath = site_url() . "/wp-content/plugins/VFB-E2Excel/plugin-parts/export.xlsx"; if (!isset($_GET['form_id'])) { echo "<br>"; echo "<h1>Please select a form:</h1>"; //if user didn't select a form display the forms to choose from new listForms(); } else { //construct the excel sheet for the chosen form $sheet = new export(); $sheet->viewEntries($_GET['form_id']); $sheet->flush2Xls(); echo "<br>"; echo "<h1>Click below to download your excel sheet</h1>"; echo '<a href="' . $xlsPath . ' "><button id="download_all" href="' . $xlsPath . '" >Download all Entries</button></a>'; } }