message.php
上传用户:xielong139
上传日期:2021-06-06
资源大小:92k
文件大小:5k
源码类别:

网络编程

开发平台:

DOS

  1. <?php
  2. header("Content-Type:text/html;charset=gbk");
  3. require_once 'Textclass.php';
  4. if($_POST['word'])$word=trim($_POST['word']);
  5. else $word=trim($_GET['url']);
  6. $word = __urljudge(str_replace('http://', '', $word));
  7. $content=array(url=>$word,ip=>$ip,time=>time());
  8. $text_class->add_line($content);
  9. function _url($Date){
  10. $ch = curl_init();
  11. $timeout = 5;
  12. curl_setopt ($ch, CURLOPT_URL, "$Date");
  13. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  14. curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
  15. curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  16. $contents = curl_exec($ch);
  17. curl_close($ch);
  18. return $contents;
  19. }
  20. $url="http://data.alexa.com/data/+wQ411en8000lA?cli=10&dat=snba&ver=7.0&cdt=alx_vw=20&wid=12206&act=00000000000&ss=1680x1050&bw=964&t=0&ttl=35371&vis=1&rq=4&url=$word";
  21. $contents.=_url($url);
  22. $contents=str_replace('<a href="/','<a href="http://www.alexa.com/',$contents);
  23. $contents = iconv("UTF-8","gbk//TRANSLIT",$contents);
  24. preg_match_all("/<POPULARITY URL="(.*?)" TEXT="(.*?)"/>/is",$contents,$num);
  25. if($num[1][0]==""){
  26. preg_match_all("/<div class="data down">(.*?)</a></div>/is",$contents,$num);
  27. }
  28. preg_match_all("/<CREATED DATE="(.*?)" DAY="(.*?)" MONTH="(.*?)" YEAR="(.*?)"/>/is",$contents,$date);
  29. preg_match_all("/<EMAIL ADDR="(.*?)"/>/is",$contents,$mail);
  30. preg_match_all("/<LINKSIN NUM="(.*?)"/>/is",$contents,$link);
  31. preg_match_all("/<ADDR STREET="(.*?)" CITY="(.*?)" STATE="(.*?)" ZIP="(.*?)" COUNTRY="(.*?)" />/is",$contents,$user);
  32. preg_match_all("/<CAT ID="(.*?)" TITLE="(.*?)" CID="(.*?)"/>/is",$contents,$type);
  33. preg_match_all("/<SITE BASE="(.*?)" TITLE="(.*?)" DESC="(.*?)">/is",$contents,$jianjie);
  34. ?>
  35. <div class="frame">
  36. <div class="title">您查询的网址:<b><?php echo $word;?></b> 在Alexa上的综合排名第<?php echo $num[2][0];?> 位</div>
  37. <div class="tab_2"><b>网站名称:</b><?php echo $num[1][0]?></div>
  38. <div class="tab_2"><b>网站排名:</b><?php echo $num[2][0];?></div>
  39. <div class="tab_2"><b>收录日期:</b><?php if(empty($date[1][0]))$date[1][0]='不详';echo $date[1][0];?></div>
  40. <div class="tab_2"><b>站长邮箱:</b><?php if(empty($mail[1][0]))$mail[1][0]='不详';echo $mail[1][0];?></div>
  41. <div class="tab_2"><b>反向链接:</b><?php if(empty($link[1][0]))$link[1][0]='不详';echo strip_tags($link[1][0]);?></div>
  42. <div class="tab_1"><b>联系方式:</b><?php if(empty($user[1][0]))$user[1][0]='不详';echo $user[1][0].$user[2][0].$user[3][0]?></div>
  43. <div class="tab_1"><b>分类目录:</b><?php if(empty($type[1][0]))$type[1][0]='不详';echo $type[1][0]?></div>
  44. <div class="tab_1"><b>网站简介:</b><?php if(empty($jianjie[3][0]))$jianjie[3][0]='不详';echo $jianjie[3][0]?></div>
  45. </div>
  46. <div class="clear"></div>
  47. <div class="frame">
  48. <div class="title">网站综合排名走势图</div>
  49. <table width="560" cellspacing="0">
  50. <tr>
  51. <td class="project_left"><a OnClick="document.all.rank1.style.display='';document.all.rank2.style.display='none';document.all.rank3.style.display='none';document.all.rank4.style.display='none';document.all.rank5.style.display='none';" style="cursor:hand">六个月平均排名</a></td>
  52. <td class="project"><a OnClick="document.all.rank1.style.display='none';document.all.rank2.style.display='';document.all.rank3.style.display='none';document.all.rank4.style.display='none';document.all.rank5.style.display='none';"style="cursor:hand">三个月平均排名</a></td>
  53. <td class="project"><a OnClick="document.all.rank1.style.display='none';document.all.rank2.style.display='none';document.all.rank3.style.display='';document.all.rank4.style.display='none';document.all.rank5.style.display='none';"style="cursor:hand">一个月平均排名</a></td>
  54. <td class="project"><a OnClick="document.all.rank1.style.display='none';document.all.rank2.style.display='none';document.all.rank3.style.display='none';document.all.rank4.style.display='';document.all.rank5.style.display='none';"style="cursor:hand">半个月平均排名</a></td>
  55. <td class="project"><a OnClick="document.all.rank1.style.display='none';document.all.rank2.style.display='none';document.all.rank3.style.display='none';document.all.rank4.style.display='none';document.all.rank5.style.display='';"style="cursor:hand">一星期平均排名</a></td>
  56. </tr>
  57. <tr>
  58. <td colspan="5" class="rank_left">
  59. <div id="rank1"><img src="http://traffic.alexa.com/graph?w=560&h=280&r=6m&y=t&u=<?php echo $word;?>" alt=" 如果看不到图片,请单击右键选择 [显示图片] "></div>
  60. <div id="rank2" style="display:none"><img src="http://traffic.alexa.com/graph?w=560&h=280&r=3m&y=t&u=<?php echo $word;?>" alt=" 如果看不到图片,请单击右键选择 [显示图片] "></div>
  61. <div id="rank3" style="display:none"><img src="http://traffic.alexa.com/graph?w=560&h=280&r=1m&y=t&u=<?php echo $word;?>" alt=" 如果看不到图片,请单击右键选择 [显示图片] "></div>
  62. <div id="rank4" style="display:none"><img src="http://traffic.alexa.com/graph?w=560&h=280&r=15.0m&y=t&u=<?php echo $word;?>" alt=" 如果看不到图片,请单击右键选择 [显示图片] "></div>
  63. <div id="rank5" style="display:none"><img src="http://traffic.alexa.com/graph?w=560&h=280&r=7.0m&y=t&u=<?php echo $word;?>" alt=" 如果看不到图片,请单击右键选择 [显示图片] "></div>
  64. </td>
  65. </tr>
  66. </table>
  67. <div><a href="http://www.alexa.gz.cn/">Alexa排名查询</a><div>
  68. </div>