利用监控宝来执行Whmcs的自动任务
span/span来源: a href=http://www.myluoluo.com/利用监控宝来执行Whmcs的自动任务.love target=_blank rel=nofollowhttp://www.myluoluo.com/利用监控宝来执行Whmcs的自动任务.love/a br / 只是给那些寻找替代计划任务
来源:
http://www.myluoluo.com/利用监控宝来执行Whmcs的自动任务.love
只是给那些寻找替代计划任务的人一个思路,刚学PHP,有哪些地方错了还望指教~
只是给那些寻找替代计划任务的人一个思路,刚学PHP,有哪些地方错了还望指教~
<?php
/*
* By: 落落
* To: GetVM.Com
* URL: www.MyLuoLuo.Com
*/
set_time_limit(0);
$fileName = "count.love";
$urls = array("http://my.XXXX.net/cron.php"
,"http://billing.XXXX.com/cron.php");
//如果文件不存在
if(!file_exists($fileName))
{
CreateFile($fileName,0);
exit();
}
if (!is_readable($fileName)) {
//文件不存在或者无法读取
die('File does not exist or could not be read!');
}else
{
$count = file_get_contents($fileName);
$count++;
//监控宝有两个节点同时访问,所以这里不是24
if($count>=48)
{
foreach ($urls as $key => $value) {
file_get_contents($value);
}
$count=0;
}
echo"$count";
DeleteFile($fileName);
CreateFile($fileName,$count);
}
//创建文件
function CreateFile($fileName,$value)
{
$fp = fopen($fileName, "w+");
fwrite($fp, $value);
fclose($fp);
}
//删除文件
function DeleteFile($fileName)
{
@unlink($fileName);
}
?>
- 上一篇:使用Leaps生成二维码
- 下一篇:php把汉字转化成拼音
精彩图集
精彩文章






