Tuesday, May 31, 2011

Can't open .docx file in Internet Explorer

If you having trouble with this situation...try to put this code


AddType application/vnd.ms-word.document.macroEnabled.12 .docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx

in file called .htaccess or you can add this code into httpd.conf...then you should open .docx file again..(close and reopen IE)..

Note : If you add in the code into httpd.conf, you should restart your server : service httpd restart.

Monday, May 23, 2011

Calculating differences between two date in months and days

<?php
$date1 = $TPC_From;
$date2 = $TPC_To;
$diff = abs(strtotime($date2) - strtotime($date1));
$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
printf("%d bulan, %d hari\n", $months, $days);  ?>

You can customize the code using your own purposes..

Thursday, May 5, 2011

HTML button tag

Do you know that the button tag in Internet Explorer will submit the text between the <button> and </button> tags but other browsers will submit the content of the value attribute as we want it to be. In IE we have to use the input element to create buttons in an HTML form, But it still can't bring the value as I want. The value attribute is the button label.


Is there a chance that IE can take value in button tag..I have try in IE 8, it can but I got a problem with compatibility view..



LinkWithin

Related Posts Plugin for WordPress, Blogger...