Tuesday 1 October 2013

Excel dan Word dalam PHP

if ($_GET['ex']=='Excel'){
header( "Content-Type: application/vnd.ms-excel" );
header( "Content-Transfer-Encoding: binary" );
header( "Cache-Control: must-revalidate" );
header( "Pragma: no-cache" );
header( "Content-Disposition: attachment; filename=filename.xls" );}

if ($_GET['md'] == 'Word'){
header('Content-Type: application/vnd.ms-word');
header('Content-Disposition: attachment; filename=filename.do');
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}




0 comments:

Post a Comment