<?
$nowtime=time();
$pastsec=$nowtime-$_GET["t"];
if ($pastsec<300) //3分钟自动更新一次,自己可以修改调整时间,每秒为60最好不要超过5分钟
{
exit;
}
ob_start(); //打开缓冲区
include("portal.php"); //index.php改成你的默认首页动态文件名
$content=ob_get_contents(); //得到缓冲区的内容
$content.="\n<script language=javascript src=\"dazles_ss.php?t=".$nowtime."\"></script>"; //index.html上自动加上调用更新程序的代码
file_put_contents("index/index.html",$content);
if (!function_exists("file_put_contents"))
{
function file_put_contents($fn,$fs)
{
$fp=fopen($fn,"w+");
fputs($fp,$fs);
fclose($fp);
}
}
?>
这个是一个PHP文件内容 我让想这个PHP运行到最后 在运行一下\index\alivv_120899.php 这个文件 代码应该怎么写哪
require 'xxx.php';
require_once 'xxx.php';
include 'xxx.php';
include_once 'xxx.php';
扩展:
如果是用命令行去运行php文件,可以使用在php安装目录下的bin目录里面的php.exe命令去运行,用这种方法运行php的一般是用作定时计划任务。
if (!function_exists("file_put_contents"))
{
function file_put_contents($fn,$fs)
{
$fp=fopen($fn,"w+");
fputs($fp,$fs);
fclose($fp);
}
}
include_once("\index\alivv_120899.php");本回答被提问者采纳