« »
2008-12-02PHP

91

PHP:如何在站点的每个PHP文件头或尾加入包含文件

1:打开php.ini文件
设置 include_path= “c:”

2:写两个文件
auto_prepend_file.php 和 auto_append_file.php 保存在c盘,他们将自动依附在每个php文件的头部和尾部.

3:在php.ini中找到:

Automatically add files before or after any PHP document.
auto_prepend_file = auto_prepend_file.php;依附在头部
auto_append_file = auto_append_file.php;依附在尾部

以后你每个php文件就相当于

  1. <?php 
  2. include "auto_prepend_file.php" ;
  3.  
  4. .......//这里是你的程序
  5.  
  6.  
  7. include "auto_append_file.php";
  8. ?>

您还可能感兴趣的内容

日志信息 »

该日志于2008-12-02 15:30由 admin 发表在PHP分类下, 你可以发表评论。除了可以将这个日志以保留源地址及作者的情况下引用到你的网站或博客,还可以通过RSS 2.0订阅这个日志的所有评论。

没有评论

发表评论 »


返回顶部