function export_article_file($data, $filename) { $text = base64_encode(serialize($data)); require_once libfile('class/zip'); $zip = new zipfile(); $zip->addFile($text, $filename . '.txt'); $text = $zip->file(); export_file($text, $filename . '.zip'); }
<?php require "settings.php"; if (isset($_REQUEST["key"])) { switch ($_REQUEST["key"]) { case "confirm": $OUTPUT = export_file(); break; default: $OUTPUT = get_employer($_POST); } } else { $OUTPUT = get_employer($_POST); } require "template.php"; function get_employer($_POST, $err = "") { global $_SESSION; extract($_POST); db_connect(); $sql = "SELECT * FROM compinfo WHERE div = '" . $_SESSION["USER_DIV"] . "'"; $Rslt = db_exec($sql); $com = pg_fetch_array($Rslt); if (!isset($employer_company)) { $employer_company = COMP_NAME; } if (!isset($employer_paye)) { $employer_paye = COMP_PAYE; } if (!isset($employer_sdl)) { $employer_sdl = $com['sdl'];