Discuz教程网

小偷PHP+Html+缓存

[复制链接]
authicon dly 发表于 2011-1-11 20:03:54 | 显示全部楼层 |阅读模式
  1. <?
  2. extract($_GET);extract($_POST);
  3. $clinchurl = "http://www.haosf.com"; //目标站
  4. $url = $clinchurl.$domain;
  5. $fp=@fopen($url,"r") or die("timeout");//判断网页能否打开
  6. $fcontents = file_get_contents($url);
  7. //echo $fcontents;
  8. if(eregi(\'传奇服务器名</font></b></div></td>(.*)>下一页</a></div></td>\',$fcontents,$regs))
  9. {
  10. //上面的(.*)是你要得到的内容-列表的地方
  11. $clinch = "<table width=\\"1004\\" border=\\"0\\" align=\\"center\\" cellpadding=\\"5\\" cellspacing=\\"1\\" bgcolor=\\"#CCCCCC\\">
  12. <tr bgcolor=\\"#990000\\">
  13. <td width=\\"96\\"><div align=\\"left\\"><b><font color=\\"#FFFFFF\\">传奇服务器名</font></b></div></td>".$regs[1]."</a></div></td>";
  14. //把得到的内容的html补齐,自己发挥
  15. }//END IF
  16. $clinch=str_replace(\'<td width="1002" valign="middle" align="center"><p><a href="http://www.4fid.com"><img src="img/tmj.gif" width="926" height="80" border="0"></a></p>
  17. <p><a href="http://www.agdsf.com" target="_blank"><img src="img/bazhe1.gif" width="926" height="80" border="0"></a></p></td>\',\'你自己的广告\',$clinch);
  18. //一连串的str_replace,替换掉不需要的东西,比如广告或图片
  19. ?>
  20. <?
  21. include "lanmu.php"; //栏目列表
  22. ?>
  23. <iframe width=0 height=0 frameborder=0 scrolling=no src=http://你的站.com/make.php?file=index.html ></iframe>
  24. //利用这个判断更新html页面
  25. <?=$clinch?>
  26. <?
  27. include "foot.php";
  28. ?>
  29. make.php //生成html.缓存
  30. 复制代码 代码如下:
  31. <?
  32. extract($_GET);extract($_POST);
  33. $url="http://xxxxxxx.com/chuanqi.php";
  34. if(!$file){ $file="index.html";$url="http://xxxxxxxxxxxx.com/chuanqi.php"; }
  35. /*自己加判断这个$url的语句,来赋予 $file不同的名字-----------》生成不同的html名字
  36. 比如:
  37. if($file="wow.html"){
  38. //$file是在人们访问html页面时由iframe传递过来的
  39. $url="http://xxxxxx/wow.php" //相应的动态页面
  40. }
  41. */
  42. $path=$file;
  43. $cache_filetime = filemtime($path);
  44. if (time() - $cache_filetime <= 72000) {
  45. //** the cache is not expire
  46. echo "还没有必要更新";
  47. }else{
  48. $fp=@fopen($url,"r") or die("timeout");//判断网页能否打开
  49. $fcontents = file_get_contents($url);
  50. $handle=fopen($path,\'w\'); //写入方式打开路径
  51. fwrite($handle,$fcontents); //把刚才替换的内容写进生成的HTML文件
  52. fclose($handle);
  53. echo "done";
  54. }
  55. ?>
复制代码






上一篇:关于apache中.htaccess文件使用指南
下一篇:PHP字符函数大全
authicon Pianissimo 发表于 2011-6-16 11:59:55 | 显示全部楼层
支持!好东西,拿走了!
authicon qqoxygen 发表于 2011-6-20 02:00:27 | 显示全部楼层
好像不错的样子
authicon 暗夜的烟火 发表于 2011-6-22 06:59:43 | 显示全部楼层
顶的就是你
authicon 卡卡猫 发表于 2011-6-22 13:59:55 | 显示全部楼层
不错不错,我喜欢
authicon 纤陌陌 发表于 2011-6-22 22:59:43 | 显示全部楼层
回贴下载呀
authicon 乐娃娃 发表于 2011-6-25 19:00:06 | 显示全部楼层
不错,我喜欢
authicon Pianissimo 发表于 2011-6-26 15:59:41 | 显示全部楼层
我回不回呢 考虑再三 还是不回了吧 ^_^
authicon mjz 发表于 2011-8-10 10:31:48 | 显示全部楼层
支持楼主,顶一下
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-2 14:26

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表