php¶ÁÈ¡ºÍ´´½¨wordÎĵµ
×ܽáϱ¾ÈËÔÚÈÕ³£¹¤×÷ÖÐʹÓÃphp²Ù×÷wordµÄһЩʵս¡£
·½·¨Ò»£ºÀûÓÃphp comÄ£¿é
¡£Ò²¼´ÀûÓÃwordÌṩµÄ±¾µØapi£¬ËùÓÐÖ»ÊÊÓÃÓÚwindowsϵͳÉÏ¡£
<?php
$word = new com('word.application') or die('ÎÞ·¨´ò¿ªword');
$word->Visiable = false;
$doc_file = '/path/to/doc';
$word->Open($doc_file);
$text = 'Õâ¶ÎÎÄ×Ö½«±»Ð´µ½wordÎĵµÖÐÈ¥';
$word->Selection->TypeText($text);
//±£´æ
$word->ActiveDocument->Save();
//¶ÁÈ¡ÄÚÈÝ
$doc_file_contents = $word->ActiveDocument->Content->Text;
//Êä³öwordÄÚÈÝ
$word->PrintOut();
$word->Close();
?>
ÀûÓÃcomÁ¬½Óword£¬¾³£ÎÞ·¨Ô¤ÆÚÔËÐгɹ¦£¬Ä¿Ç°Ò²²»ÖªµÀÊÇʲôÔÒò£¬ÔÝʱ¿¿ÔËÆø°É¡£
·½·¨¶þ£ºÀûÓÃcatdoc¡£catdocÊÇlinuxÉϵŤ¾ß£¬ÐèÒª×ÔÐа²×°ÅäÖá£
<?php
//catdocλÖÃ
$cat_doc = '/usr/local/bin/catdoc';
$doc_file = 'this is a doc file';
//¶ÁÈ¡wordÎļþÄÚÈÝ
$doc_file_contents = shell_exec($cat_doc . ' ' . $doc_file);
echo nl2br($doc_file_contents);
?>
¸ü¶àcatdocµÄ¹¦ÄÜ£¬Çë²éÔÄcatdocÎĵµ¡£
ÓÉÓÚcatdocÊÇlinuxµÄ¹¤¾ß£¬ËùÒÔÉÏÃæµÄÕâ¶Î´úÂëÖ»ÄÜÔËÐÐÔÚlinux·þÎñÆ÷ÉÏ£¬¶øÒѱØÐë°²×°ÁËcatdoc¡£
Ïà¹ØÎĵµ£º
it is 21th of May. The Month of PHP Security
(http://www.php-security.org) is still running and we have reached a
vulnerability count of 40 vulnerabilities, which is nearly as much as we
disclosed during the whole Month of PHP Bugs in 2007. However there are
11 more days until the end of May and ......
ÓÃPHP±à³Ì£¬Ê¹Óûñȡʱ¼äµÄ´úÂ룬µ«ÊÇ»ñÈ¡µ½µÄʱ¼ä×ÜÊDZȵ±Ç°Ê±¼äÔç8¸öСʱ£¬°Ù˼²»µÃÆä½â£¬ÔÚÍøÉÏËÑË÷ÁËÏ£¬ÖÕÓÚÕÒµ½Á˽â¾ö°ì·¨£¬ÔÀ´ÊÇʱÇøÉèÖÃÎÊÌâ¡£ ½â¾ö°ì·¨Ò»£º ÔÚphp.iniÀïÉèÖà date.timezone = ʱÇø ½â¾ö°ì·¨¶þ£º ²»ÓÃÐÞ¸Äphp.inÎļþ£¬Ö±½ÓÔÚ»ñȡʱ¼äµÄ´úÂëÇ°Ãæ¼ÓÉÏ£º date_default_timezone_set('ʱÇø'); ±ÈÈ ......
¡¾1¡¿Ò³ÃæÖ®¼äÎÞ·¨´«µÝ±äÁ¿ get,post,sessionÔÚ×îеÄphp°æ±¾ÖÐ×Ô¶¯È«¾Ö±äÁ¿Êǹرյģ¬ËùÒÔÒª´ÓÉÏÒ»Ò³ÃæÈ¡µÃÌá½»¹ýÀ´µÃ±äÁ¿ÒªÊ¹ÓÃ$_GET['foo'],$_POST['foo'],$_SESSION['foo']À´µÃµ½¡£µ±È»Ò²¿ÉÒÔÐÞ¸Ä×Ô¶¯È«¾Ö±äÁ¿Îª¿ª(php.ini¸ÄΪregister_globals = On)£»¿¼Âǵ½¼æÈÝÐÔ£¬»¹ÊÇÇ¿ÆÈ×Ô¼ºÊìϤеÄд·¨±È½ÏºÃ¡£
¡¡¡¡¡¾2¡¿Wi ......
<?php
//µ¥ÀýģʽµÄÀàLock
class
Lock
{
//¾²Ì¬ÊôÐÔ$instance
  ......