PHP Indonesia - Facebook | PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ | |
 | Manage your social media
Best social media tool for image publishing to Facebook and Twitter. Look amazing and delight your followers. Get 40% off when you sign up today.  | From our sponsors | | |
header("Content-Type: application/vnd.ms-excel"); ... Oct 17th 2013, 06:59, by Nurul Laily | header("Content-Type: application/vnd.ms-excel"); header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=contoh-pegawai.xls");//ganti nama sesuai keperluan header("Pragma: no-cache"); header("Expires: 0");
mau bikin laporan ke excel tapi malah keluar warning kaya gini : Warning: Cannot modify header information - headers already sent by...
dibantu ya mas2 :( |
| | header("Content-Type: application/vnd.ms-excel"); header("Content-type: application/octet-stream"); kok dobel mbak |
| | contoh1 <?php header("Content-Type: application/vnd.ms-excel"); header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=contoh-pegawai.xls");//ganti nama sesuai keperluan header("Pragma: no-cache"); header("Expires: 0");
Mesti ditaro seperti itu,jangan ada sesuatu di atas statement header yang mengakibatkan seolah-olah header dikirim.
contoh2 <?php echo "1"; header("Content-Type: application/vnd.ms-excel"); header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=contoh-pegawai.xls");//ganti nama sesuai keperluan header("Pragma: no-cache"); header("Expires: 0");
Contoh2 adalah keliru
contoh3.1 <html> <?php header("Content-Type: application/vnd.ms-excel"); header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=contoh-pegawai.xls");//ganti nama sesuai keperluan header("Pragma: no-cache"); header("Expires: 0"); ------------ contoh3.2 [spasi] <?php header("Content-Type: application/vnd.ms-excel"); header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=contoh-pegawai.xls");//ganti nama sesuai keperluan header("Pragma: no-cache"); header("Expires: 0");
Contoh3.x diatas juga keliru karena header sudah terbuat dengan bentuk contoh3.x diatas |
| | oh sama aja ya? harusnya gimana mas Awan? |
| | contoh4 <?php if(true) { header("Content-Type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=contoh-pegawai.xls");//ganti nama sesuai keperluan header("Pragma: no-cache"); header("Expires: 0"); }
contoh diatas betul ketika menggunakan header, karena belum ada command yang semisal echo atau yang menghasilkan sesuatu yang di cetak di browser. |
| | saya kan pake dreamweaver jadi default udah kepasang tag html di editor... mmmmm gitu ya.. ilmu baru lagi.. makasih banyak ya mas Ricky Wisnadri S. Kom ^_^ | | |
|
Tidak ada komentar:
Posting Komentar