21,886
社区成员
发帖
与我相关
我的任务
分享
建立外部引入变量文件 config.php 内容如下:
<?php
return 1;//1执行脚本 0退出执行脚本
?>
监测脚本如下:
<?php
ignore_user_abort();//关闭浏览器后,继续执行php代码
set_time_limit(0);//程序执行时间无限制
$sleep_time = 60;//多长时间执行一次
do{
$run = include 'config.php';
if(!$run) break; // 停止脚本
//这里写你监测页面的代码
sleep($sleep_time);
}while();
?>
$homepage = file_get_contents('http://www.example.com/A.html');
if(strpos($homepage,'')>=0){
file_get_contents('http://www.example.com/G.php');
}