修改php.ini在网站的所有文件添加头尾文件

1:打开php.ini文件
开始编辑
找到
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

开始设置如下:

UNIX: "/path1:/path2"
;include_path = ".:/home/wwwroot/view" 指定你想要网站放问的文件的目录(自行设置)这里我指定在view目

录下。

继续查找

Automatically add files before or after any PHP document.

auto_prepend_file = top.php; 头部文件
auto_append_file = bottom.php; 底部文件

2:写两个文件

top.php 和 bottom.php 保存在/home/wwwroot/view文件夹里,他们将自动依附在每个php文件的头部和底部.

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

<?php
Include "top.php" ;

.......//这里是你的程序

Include "bottom.php.php";
?>

这样是不是很方便啊,呵呵。。

大家也可以用这个来做统计。比如啊江的统计。

大家可以按此类推。。可以有用于好多地方。

本文出自 http://bbs.lrdown.com/thread-1797-1-5.html

-->点这里查看Bluehost支持的环境和产品详情列表。