- 论坛徽章:
- 0
|
新人 刚开始弄代码 在学习一个简单的 小偷程序 遇到了 有关链接的问题 自己无法解决 望各位CU的大哥帮忙
谢谢
INDEX.PHP
<?php
require './commom.php';
update("index.htm");
$file=readfromfile("cache/index.htm");
$gyrj = cut($file,"Rechecked", "sign means SSL support");
?>
<?php echo $gyrj;
?>
config.php
<?php
$fromurl = "http://www.samair.ru/proxy/";
$flush="120";//update函数中自动同步更新时间
?>
GLOBAL.PHP
<?php
function open($file,$type=''){
global $fromurl,$referer;
$cachename=$file;
if($type){
$file=$fromurl.'/'.$type.'/'.$file;
}else{
$file=$fromurl.$file;
}
if($open=file($file)){
$count=count($open);
for($i=0;$i<$count;$i++){
$theget.=$open[$i];
}
}else{
die('请求过多,超时,请刷新');
}
return $theget;
}
function update($file,$type=''){
//更新cache中的文件
global $timestamp,$flush;
if(!file_exists("cache/$file")){
if($type){
$data=open($file,$type);
}else{
$data=open($file);
}
writetofile("cache/$file",$data);
}else{
$lastflesh=@filemtime("cache/$file");
if($lastflesh + ($flush * 60) < $timestamp ){
if($type){
$data=open($file,$type);
}else{
$data=open($file);
}
writetofile("cache/$file",$data);
}
}
}
function readfromfile($file_name) {
if($filenum=fopen($file_name,"r")){
flock($filenum,LOCK_SH);
$file_data=fread($filenum,filesize($file_name));
fclose($filenum);
return $file_data;
}else{
return false;
}
}
function writetofile($file_name,$data,$method="w") {
if($filenum=fopen($file_name,$method)){
flock($filenum,LOCK_EX);
$file_data=fwrite($filenum,$data);
fclose($filenum);
return $file_data;
}else{
return false;
}
}
function cut($file,$from,$end){
$message=explode($from,$file);
$message=explode($end,$message[1]);
return $message[0];
}
function updatecache($file,$cache=''){
global $timestamp,$flush;
if(!file_exists($file)){
writetofile($file,$cache);
$return=$cache;
}elseif(@filemtime($file) < $timestamp - ($flush * 60)){
writetofile($file,$cache);
$return=$cache;
}else{
$return=readfromfile($file);
}
return $return;
}
?>
COMMOM.PHP
<?php
include './config.php';
include './global.php';
?>-----------------------
演示地址 http://www.zanwen.org/cs/
把页面抓过来后
有 20个链接
如何把链接也抓过来?
谢谢!祝:大家新年快乐! |
|