获取alexa 基本信息代码

 更新时间:2016年11月25日 15:58  点击:1910

$url ='http://data.alexa.com/data/?cli=10&dat=snba&ver=7.0&url='.$q;
  $xml = simplexml_load_file($url);
  //echo $xml;
  $SD=$xml->SD;
  //print_r($SD);
   $rank = number_format($SD[1]->POPULARITY['TEXT']);
   $rankdelta = number_format($SD[1]->RANK['DELTA']);
   
//$url = 'http://data.alexa.com/data/?cli=10&dat=snba&ver=7.0&url='.$q;
//  $xml = simplexml_load_file($url);
//  $SD=$xml->SD;
 //  $rank = number_format($SD->POPULARITY['TEXT']);
  // $rankdelta = number_format($SD->RANK['DELTA']);
   $reachrank = number_format($SD->REACH['RANK']);
   $title = $SD->TITLE['TEXT'];
   $linksin = $SD->LINKSIN['NUM'];
   $owner = $SD->OWNER['NAME'];
   $email = $SD->EMAIL['ADDR'];
   $phonenumber = $SD->PHONE['NUMBER'];
   $createddate = $SD->CREATED['DATE'];
   $speedtext = number_format($SD->SPEED['TEXT']);
   $speedpct = number_format($SD->SPEED['PCT']);
   $langlex = $SD->LANG['LEX'];
   $langcode = $SD->LANG['CODE'];
   $street = $SD->ADDR['COUNTRY'].' '.$SD->ADDR['STATE'].' '.$SD->ADDR['CITY'].' '.$SD->ADDR['STREET'].' '.$SD->ADDR['CITY'];
   $sitedesc = $xml->DMOZ->SITE['DESC'];
   $cat = $xml->DMOZ->SITE->CATS->CAT['ID'];?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ip归属地</title>

</head>
<body>
<h1>IP地址查询</h1>
<form id="form1" name="form1" method="post" action="">
  <input type="text" name="ipinfo" id="ipinfo" style="border:solid 1px #fdbdd5" />
  <input type="submit" name="button" id="button" value="查询" style="border:solid 1px #fdbdd5;width:50px" />
</form>
<?php教程
include("ipcheck.class.php");
$ipinfo=$_POST['ipinfo'];
$iptest=new IpLocation();
echo $iptest->getlocation($ipinfo);
?>
</body>
</html>

//ipcheck.class.php代码如下

<?php

class IpLocation {
/**
* QQWry.Dat文件指针
* @var resource
*/
var $fp;
/**
* 第一条IP记录的偏移地址
*
* @var int
*/
var $firstip;
/**
* 最后一条IP记录的偏移地址
*
* @var int
*/

var $lastip;

/**
* IP记录的总条数(不包含版本信息记录)
*
* @var int
*/

var $totalip;

/**
* 返回读取的长整型数
*
* @access private
* @return int
*/

function getlong() {

//将读取的little-endian编码的4个字节转化为长整型数

$result = unpack('Vlong', fread($this->fp, 4));

return $result['long'];

}

/**
* 返回读取的3个字节的长整型数
*
* @access private
* @return int
*/

function getlong3() {

//将读取的little-endian编码的3个字节转化为长整型数

$result = unpack('Vlong', fread($this->fp, 3).chr(0));

return $result['long'];

}

/**
* 返回压缩后可进行比较的IP地址
*
* @access private
* @param string $ip
* @return string
*/

function packip($ip) {

// 将IP地址转化为长整型数,如果在PHP5中,IP地址错误,则返回False,

// 这时intval将Flase转化为整数-1,之后压缩成big-endian编码的字符串

return pack('N', intval(ip2long($ip)));

}

/**
* 返回读取的字符串
*
* @access private
* @param string $data
* @return string
*/

function getstring($data = "") {

$char = fread($this->fp, 1);

while (ord($char) > 0) { // 字符串按照C格式保存,以结束

$data .= $char; // 将读取的字符连接到给定字符串之后

$char = fread($this->fp, 1);

}

return $data;

}

/**
* 返回地区信息
*
* @access private
* @return string
*/

function getarea() {

$byte = fread($this->fp, 1); // 标志字节

switch (ord($byte)) {

case 0: // 没有区域信息

$area = "";

break;

case 1:

case 2: // 标志字节为1或2,表示区域信息被重定向

fseek($this->fp, $this->getlong3());

$area = $this->getstring();

break;

default: // 否则,表示区域信息没有被重定向

$area = $this->getstring($byte);

break;

}

return $area;

}

/**
* 根据所给 IP 地址或域名返回所在地区信息
*
* @access public
* @param string $ip
* @return array
*/

function getlocation($ip) {

if (!$this->fp) return null; // 如果数据文件没有被正确打开,则直接返回空

$location['ip'] = gethostbyname($ip); // 将输入的域名转化为IP地址
$ip = $this->packip($location['ip']); // 将输入的IP地址转化为可比较的IP地址
// 不合法的IP地址会被转化为255.255.255.255
// 对分搜索
$l = 0; // 搜索的下边界
$u = $this->totalip; // 搜索的上边界
$findip = $this->lastip; // 如果没有找到就返回最后一条IP记录(QQWry.Dat的版本信息)
while ($l <= $u) { // 当上边界小于下边界时,查找失败

$i = floor(($l + $u) / 2); // 计算近似中间记录

fseek($this->fp, $this->firstip + $i * 7);

$beginip = strrev(fread($this->fp, 4)); // 获取中间记录的开始IP地址

// strrev函数在这里的作用是将little-endian的压缩IP地址转化为big-endian的格式

// 以便用于比较,后面相同。

if ($ip < $beginip) { // 用户的IP小于中间记录的开始IP地址时

$u = $i - 1; // 将搜索的上边界修改为中间记录减一

}

else {

fseek($this->fp, $this->getlong3());

$endip = strrev(fread($this->fp, 4)); // 获取中间记录的结束IP地址

if ($ip > $endip) { // 用户的IP大于中间记录的结束IP地址时

$l = $i + 1; // 将搜索的下边界修改为中间记录加一

}

else { // 用户的IP在中间记录的IP范围内时

$findip = $this->firstip + $i * 7;
break; // 则表示找到结果,退出循环

}

}

}

//获取查找到的IP地理位置信息
fseek($this->fp, $findip);
$location['beginip'] = long2ip($this->getlong()); // 用户IP所在范围的开始地址
$offset = $this->getlong3();
fseek($this->fp, $offset);
$location['endip'] = long2ip($this->getlong()); // 用户IP所在范围的结束地址
$byte = fread($this->fp, 1); // 标志字节
switch (ord($byte)) {

case 1: // 标志字节为1,表示国家和区域信息都被同时重定向

$countryOffset = $this->getlong3(); // 重定向地址

fseek($this->fp, $countryOffset);

$byte = fread($this->fp, 1); // 标志字节

switch (ord($byte)) {

case 2: // 标志字节为2,表示国家信息又被重定向

fseek($this->fp, $this->getlong3());

$location['country'] = $this->getstring();

fseek($this->fp, $countryOffset + 4);

$location['area'] = $this->getarea();

break;

default: // 否则,表示国家信息没有被重定向

$location['country'] = $this->getstring($byte);

$location['area'] = $this->getarea();

break;
}

break;

case 2: // 标志字节为2,表示国家信息被重定向

fseek($this->fp, $this->getlong3());

$location['country'] = $this->getstring();

fseek($this->fp, $offset + 8);

$location['area'] = $this->getarea();

break;

default: // 否则,表示国家信息没有被重定向

$location['country'] = $this->getstring($byte);

$location['area'] = $this->getarea();

break;

}

if ($location['country'] == " CZ88.NET") { // CZ88.NET表示没有有效信息

$location['country'] = "未知";

}

if ($location['area'] == " CZ88.NET") {

$location['area'] = "";

}

//return $location;
echo "你的IP:".$location['ip']."<br />来自".$location['country'].$location['area'];

}

/**
* 构造函数,打开 QQWry.Dat 文件并初始化类中的信息
*
* @param string $filename
* @return IpLocation
*/

function IpLocation($filename = "QQWry.Dat") {

if (($this->fp = @fopen($filename, 'rb')) !== false) {

$this->firstip = $this->getlong();

$this->lastip = $this->getlong();

$this->totalip = ($this->lastip - $this->firstip) / 7;

//注册析构函数,使其在程序执行结束时执行

register_shutdown_function(array(&$this, '_IpLocation'));

}

}

/**
* 析构函数,用于在页面执行结束后自动关闭打开的文件。
*
*/

function _IpLocation() {

fclose($this->fp);

}

}

?>

$k=trim($_GET['k']);
$u=trim($_GET['u']);
$arrKeywords=explode(",",$k);
for($ii=0;$ii<count($arrKeywords);$ii++){
$outputstr='';
  for($i=0;$i<10;$i++){
  $sourcecode= @file_get_contents("http://www.google.cn/search?num=100&q=".$arrKeywords[$ii]);
   if($sourcecode){
   break;
   }
  }
 preg_match_all('/<li class=g>(.*?)<cite>(.*?)//', $sourcecode, $urlmatches);
  for($j=0;$j<count($urlmatches[2]);$j++){
   if(strstr($urlmatches[2][$j],$u)){
   $outputstr.=1+$j.',';
   }
  }
   if($outputstr<>''){
    echo '<script type="text/javascript教程">parent.document.getElementById("Googlek'.$ii.'").innerHTML = "'.$outputstr.'";</script>';
   }else{
    echo '<script type="text/javascript">parent.document.getElementById("Googlek'.$ii.'").innerHTML = "排名100以外";</script>';
   }
}

<?php教程
header("Content-Type:text/html;charset=gbk");
include_once 'Textclass.php';
$url='111cn.net教程';
if(empty($url) || $url == '')$url = $_GET['message'];
if(preg_match("/(.*?)/$/i",$url)){
 $url=preg_replace("//$/","",$url);
}
$message=__urljudge(eregi_replace("http://","",$url));
$content=array(message=>$message,ip=>$Myip,time=>time());
$text_class->add_line($content);
function _link($url){
 $contents = @file_get_contents("$url");
 if($contents=="Forbidden" || $contents==""){
  $ch = curl_init();
  $timeout = 5;
  curl_setopt ($ch, CURLOPT_URL, "$url");
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
  curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  $contents = curl_exec($ch);
  curl_close($ch);
 }
 if(empty($contents)){
  exit('<font color=red>cant locaion.</font>');
 }
 preg_match_all("/charset=(.*?)>/is",$contents,$cod);
 if(!empty($cod[1][0])){
  if(preg_match("/utf-8/i",$cod[1][0])){
   $contents=iconv("UTF-8","gbk//TRANSLIT",$contents);
  }
 }
 return $contents;
}
$contents=_link($url);
preg_match_all("/<a href=(.*?)</a>/is",$contents,$link);
foreach($link[0] as $val){
 if(strip_tags($val)){
  preg_match_all("/<a href="(.*?)"/is",$val,$link_url);
  $links[] = $val;
  if(preg_match("/http/i",$link_url[1][0])){
   if(!preg_match("/$message/i",$link_url[1][0])){
    $links_out[] = $link_url[1][0];
    $array[]= '<div class=list_left>'.strip_tags($val).'</div><div class=list_right><a href="'.$link_url[1][0].'">'.$link_url[1][0].'</a></div>';
   }else{
    $array[]= '<div class=list_left>'.strip_tags($val).'</div><div class=list_right><a href="'.$link_url[1][0].'">'.$link_url[1][0].'</a></div>';
   }
  }else{
   if(!preg_match("/^/(.*?)/",$link_url[1][0]))$link_url[1][0]='/'.$link_url[1][0];
   $array[]= '<div class=list_left>'.strip_tags($val).'</div><div class=list_right><a href="'.$url.$link_url[1][0].'">'.$url.$link_url[1][0].'</a></div>';
  }
 }
}

if(!empty($link)){
 echo "<b>网站:<font color=red>".$url."</font></b><br><br>";
 echo "<div id=list_top><b>共有链接<font color=red>".count($links)."</font>,内链<font color=red>".(count($links)-count($links_out))."</font>,外链<font color=red>".count($links_out)."</font></b><br><br></div>";
echo "<a href="./">返回查询首页</a>";
}else{echo "<br><br>网站:<font color=red>".$url."</font>无法查询,请更换查询地址!";}
?>
<form method="post" id="shoulu">
 <div class="pxd13">
网址:<input type="text" name="message" class="input_1" id="message">
   <input type="submit"   name="Submity" class="button"  value=" 提交 ">
 </div></form>
<?php
require_once 'Textclass.php';
$history=$text_class->openFile();
sort($history,SORT_DESC);
foreach($history as $k => $v){
 $h[] = $v[0];
}
if($h)$history = array_flip(array_flip($h));
?>
<div id="leftcontent_2"></div>
 <?php if ($history){
  foreach ($history as $val){
   echo "<a href=link.php?message=$val class='urls'>".$val."</a>";
  }
 }else{
  echo "<br><p>暂无记录</p>";
 }
 ?>
 </div>

$q=trim($_GET['q']);
$sd=(int)trim($_GET['sd']);
$t=(int)trim($_GET['t']);
if(strstr($q, " ")){
 $isulist=1;
 $ulist=explode(" ",$q);
 for($i=0;$i<count($ulist);$i++){
  $domain='';
  $domain=matchdomain($ulist[$i]);
  if($domain<>''){
   $q2.=$domain." ";
  }
 }
 $ulist=explode(" ",$q2);
}else{
$q2=matchdomain($q);
}

<div  class=contentbox>
<div class="content_nav"><span class="tt">Google PageRank查询</span></div>
<div class=toolitem>
<br><form action="" method="get">
<table style="vertical-align:middle;"><tr><td>
域名:</td><td><textarea rows="5" cols="40" style="border: 1px solid rgb(126, 157, 185); background-color: white;" id="query"  name="q" autocomplete="off" type="text">
<?php教程
if($q2<>""){
 echo $q2;
}else{
echo "www.111cn.net tool.111cn.net down.111cn.net baidu.com google.com";
}
?>
</textarea>
</td><td>
<input type="checkbox" name="sd" value="1"
<?php if($sd==1){ echo 'checked="checked"';} ?>
/> 查询二级域名PR
<br><input type="checkbox" name="t" value="1"
<?php if($t==1){ echo 'checked="checked"';} ?>
/> 鉴别真假
</td><td>
 <span class="backgroundbord"><button class="srh_onesearch" type="submit">查      询</button></span>
</td></table>
</form>
</div>
</div>
<?php
require_once '../ad/mid.php';
if($q2==''){
?>
<div class=contentbox>
<div class="content_nav"><span class="tt">工具说明</span></div>
<div class=topmenuitem>
<p>请输入域名,如chaxun.la。<br>多域名查询请每行输入一个域名,域名没有个数限制!<br><font color=red>查询二级域名PR:</font>将查询该域名的二级域名的PR。(二级域名通过查询本站数据库教程获得,并不全面!)<br><font color=red>鉴别真假:</font>将鉴别该域名的PR是否是劫持其它网站的PR。</p>
</div>
</div>

<?php
}else{
 echo "<div class=contentbox>";
 echo '<div class="content_nav"><span class="tt">查询结果</span></div>';
 echo "<div class=topmenuitem>";
   echo '<span style="width=200px;text-align:right;padding-right:50px;">域名</span><span class="span_iframe">PR</span>';
   if($t){ echo '<span class="span_iframe_pr">鉴别真假</span>';}
   echo '<br>';
 if($isulist){
  for($jj=0;$jj<count($ulist)-1;$jj++){
  $ch=get_pagerank('http://'.$ulist[$jj]);
   echo '<span style="width=200px;text-align:right;padding-bottom:6px;"><a target="_blank" href="http://'.$ulist[$jj].'"><font color=red>'.$ulist[$jj].'</font></a>:</span><span class="span_iframe"><iframe src="http://toolbarqueries.google.com/search?client=navclient-auto&googleip=O;937&ie=UTF-8&oe=UTF-8&features=Rank&ch='.$ch.'&q=info:'.$ulist[$jj].'" width="82" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" class="iframe"></iframe></span>';
   if($t){ echo '<span class="span_iframe_pr"><iframe src="tfpr.php?q='.$ulist[$jj].'" width="500" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe></span>';}
   echo '<br>';
   if($sd){
   //从数据库读取此域名的二级域名
    $topdomain=topdomain($ulist[$jj]);
    $sql="select domain from c_domainlist where topdomain='$topdomain' and domain<>'$ulist[$jj]' order by domain";
    $result=mysql教程_query($sql);
    //or die(mysql_error());
    while($row=mysql_fetch_array($result)){
     $ch=get_pagerank('http://'.$row['domain']);
    echo '<span style="width=200px;text-align:right;padding-bottom:6px;"><a target="_blank" href="http://'.$row['domain'].'">'.$row['domain'].'</a>:</span><span class="span_iframe"><iframe src="http://toolbarqueries.google.com/search?client=navclient-auto&googleip=O;937&ie=UTF-8&oe=UTF-8&features=Rank&ch='.$ch.'&q=info:'.$row['domain'].'" width="82" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" class="iframe"></iframe></span>';
    if($t){ echo '<span class="span_iframe_pr"><iframe src="tfpr.php?q='.$row['domain'].'" width="500" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe></span>';}
    echo '<br>';
    }
   }
  }
 }else{
   $ch=get_pagerank('http://'.$q2);
   echo '<span style="width=200px;text-align:right;padding-bottom:6px;"><a target="_blank" href="http://'.$q2.'"><font color=red>'.$q2.'</font></a>:</span><span class="span_iframe"><iframe src="http://toolbarqueries.google.com/search?client=navclient-auto&googleip=O;937&ie=UTF-8&oe=UTF-8&features=Rank&ch='.$ch.'&q=info:'.$q2.'" width="82" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" class="iframe"></iframe></span>';
   if($t){ echo '<span class="span_iframe_pr"><iframe src="tfpr.php?q='.$q2.'" width="500" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe></span>';}
    echo '<br>';
   if($sd){
   //从数据库读取此域名的二级域名
    $topdomain=topdomain($q2);
    $sql="select domain from c_domainlist where topdomain='$topdomain' and domain<>'$q2' order by domain";
    $result=mysql_query($sql);
    //or die(mysql_error());
    while($row=mysql_fetch_array($result)){
     $ch=get_pagerank('http://'.$row['domain']);
    echo '<span style="width=200px;text-align:right;padding-bottom:6px;"><a target="_blank" href="http://'.$row['domain'].'">'.$row['domain'].'</a>:</span><span class="span_iframe"><iframe src="http://toolbarqueries.google.com/search?client=navclient-auto&googleip=O;937&ie=UTF-8&oe=UTF-8&features=Rank&ch='.$ch.'&q=info:'.$row['domain'].'" width="82" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" class="iframe"></iframe></span>';
    if($t){ echo '<span class="span_iframe_pr"><iframe src="tfpr.php?q='.$row['domain'].'" width="500" height="20" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe></span>';}
    echo '<br>';
    }
   }
  }
echo "</div></div>";
}
function get_pagerank($permalink){
 $gpr = new PageRank();
 return $gpr->ch("$permalink");
}

class PageRank{
// 7/25/2008 - Updated by Askie (http://www.pkphp.com/)
// 3/20/2008 - Updated by Roger Collins (http://www.rogercollins.com/)
// to remove graphing step

//PageRank Lookup v1.1 by HM2K (update: 31/01/07)
//based on an alogoritham found here: http://pagerank.gamesaga.net/

 //settings - host and user agent
 var $googlehost='toolbarqueries.google.com';
 var $googleua='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5';

 //convert a string to a 32-bit integer
 function StrToNum($Str, $Check, $Magic) {
     $Int32Unit = 4294967296;  // 2^32

     $length = strlen($Str);
     for ($i = 0; $i < $length; $i++) {
         $Check *= $Magic;    
         //If the float is beyond the boundaries of integer (usually +/- 2.15e+9 = 2^31),
         //  the result of converting to integer is undefined
         //  refer to http://www.php.net/manual/en/language.types.integer.php
         if ($Check >= $Int32Unit) {
             $Check = ($Check - $Int32Unit * (int) ($Check / $Int32Unit));
             //if the check less than -2^31
             $Check = ($Check < -2147483648) ? ($Check + $Int32Unit) : $Check;
         }
         $Check += ord($Str{$i});
     }
     return $Check;
 }

 //genearate a hash for a url
 function HashURL($String) {
     $Check1 = $this->StrToNum($String, 0x1505, 0x21);
     $Check2 = $this->StrToNum($String, 0, 0x1003F);

     $Check1 >>= 2;    
     $Check1 = (($Check1 >> 4) & 0x3FFFFC0 ) | ($Check1 & 0x3F);
     $Check1 = (($Check1 >> 4) & 0x3FFC00 ) | ($Check1 & 0x3FF);
     $Check1 = (($Check1 >> 4) & 0x3C000 ) | ($Check1 & 0x3FFF);   
    
     $T1 = (((($Check1 & 0x3C0) << 4) | ($Check1 & 0x3C)) <<2 ) | ($Check2 & 0xF0F );
     $T2 = (((($Check1 & 0xFFFFC000) << 4) | ($Check1 & 0x3C00)) << 0xA) | ($Check2 & 0xF0F0000 );
    
     return ($T1 | $T2);
 }

 //genearate a checksum for the hash string
 function CheckHash($Hashnum) {
     $CheckByte = 0;
     $Flag = 0;

     $HashStr = sprintf('%u', $Hashnum) ;
     $length = strlen($HashStr);
    
     for ($i = $length - 1;  $i >= 0;  $i --) {
         $Re = $HashStr{$i};
         if (1 === ($Flag % 2)) {             
             $Re += $Re;    
             $Re = (int)($Re / 10) + ($Re % 10);
         }
         $CheckByte += $Re;
         $Flag ++;   
     }

     $CheckByte %= 10;
     if (0 !== $CheckByte) {
         $CheckByte = 10 - $CheckByte;
         if (1 === ($Flag % 2) ) {
             if (1 === ($CheckByte % 2)) {
                 $CheckByte += 9;
             }
             $CheckByte >>= 1;
         }
     }

     return '7'.$CheckByte.$HashStr;
 }

 //return the pagerank checksum hash
 function getch($url) { return $this->CheckHash($this->HashURL($url)); }

 //return the pagerank figure
 function ch($url){
  $urlinfo=parse_url($url);
     $start=$urlinfo["scheme"]<>""?strlen($urlinfo["scheme"]."://"):0;
  $url=substr($url,$start);
  
  $pr = 0;    // default return
     $ch = $this->getch($url);
  return $ch;
 }
}

$q=trim($_GET['q']);
//for($i=0;$i<5;$i++){
$pagecode = @file_get_contents("http://www.google.cn/search?q=info:".$q);
 //   if($pagecode){
// break;
// }
//}
    if($pagecode){
  preg_match('/<cite>(.*?)//', $pagecode, $googlepr);
  if($q==$googlepr[1] or strstr($googlepr[1], '.'.$q) or strstr($q, '.'.$googlepr[1])){
   echo '<font style="color:green;font-weight:bold;">√</font>';
  }elseif($q<>$googlepr[1] and $googlepr[1]<>''){
   echo '<font style="color:red;font-weight:bold;">×</font>,此网站可能劫持'.$googlepr[1].'的PR!';
  }elseif($googlepr[1]==''){
   echo '在Google搜索info:'.$q.'无信息!';
  }
 }else{
 echo "获取Google信息失败!"; 
 }

[!--infotagslink--]

相关文章

  • PHP成员变量获取对比(类成员变量)

    下面本文章来给大家介绍在php中成员变量的一些对比了,文章举了四个例子在这例子中分别对不同成员变量进行测试与获取操作,下面一起来看看。 有如下4个代码示例,你认...2016-11-25
  • php 获取用户IP与IE信息程序

    php 获取用户IP与IE信息程序 function onlineip() { global $_SERVER; if(getenv('HTTP_CLIENT_IP')) { $onlineip = getenv('HTTP_CLIENT_IP');...2016-11-25
  • php获取一个文件夹的mtime的程序

    php获取一个文件夹的mtime的程序了,这个就是时间问题了,对于这个问题我们来看小编整理的几个例子,具体的操作例子如下所示。 php很容易获取到一个文件夹的mtime,可以...2016-11-25
  • 不打开网页直接查看网站的源代码

      有一种方法,可以不打开网站而直接查看到这个网站的源代码..   这样可以有效地防止误入恶意网站...   在浏览器地址栏输入:   view-source:http://...2016-09-20
  • php 调用goolge地图代码

    <?php require('path.inc.php'); header('content-Type: text/html; charset=utf-8'); $borough_id = intval($_GET['id']); if(!$borough_id){ echo ' ...2016-11-25
  • 如何获取网站icon有哪些可行的方法

    获取网站icon,常用最简单的方法就是通过website/favicon.ico来获取,不过由于很多网站都是在页面里面设置favicon,所以此方法很多情况都不可用。 更好的办法是通过google提供的服务来实现:http://www.google.com/s2/favi...2014-06-07
  • JS基于Mootools实现的个性菜单效果代码

    本文实例讲述了JS基于Mootools实现的个性菜单效果代码。分享给大家供大家参考,具体如下:这里演示基于Mootools做的带动画的垂直型菜单,是一个初学者写的,用来学习Mootools的使用有帮助,下载时请注意要将外部引用的mootools...2015-10-23
  • JS+CSS实现分类动态选择及移动功能效果代码

    本文实例讲述了JS+CSS实现分类动态选择及移动功能效果代码。分享给大家供大家参考,具体如下:这是一个类似选项卡功能的选择插件,与普通的TAb区别是加入了动画效果,多用于商品类网站,用作商品分类功能,不过其它网站也可以用,...2015-10-21
  • JS实现自定义简单网页软键盘效果代码

    本文实例讲述了JS实现自定义简单网页软键盘效果。分享给大家供大家参考,具体如下:这是一款自定义的简单点的网页软键盘,没有使用任何控件,仅是为了练习JavaScript编写水平,安全性方面没有过多考虑,有顾虑的可以不用,目的是学...2015-11-08
  • php 取除连续空格与换行代码

    php 取除连续空格与换行代码,这些我们都用到str_replace与正则函数 第一种: $content=str_replace("n","",$content); echo $content; 第二种: $content=preg_replac...2016-11-25
  • jquery如何获取元素的滚动条高度等实现代码

    主要功能:获取浏览器显示区域(可视区域)的高度 : $(window).height(); 获取浏览器显示区域(可视区域)的宽度 :$(window).width(); 获取页面的文档高度 $(document).height(); 获取页面的文档宽度 :$(document).width();...2015-10-21
  • php简单用户登陆程序代码

    php简单用户登陆程序代码 这些教程很对初学者来讲是很有用的哦,这款就下面这一点点代码了哦。 <center> <p>&nbsp;</p> <p>&nbsp;</p> <form name="form1...2016-11-25
  • PHP实现清除wordpress里恶意代码

    公司一些wordpress网站由于下载的插件存在恶意代码,导致整个服务器所有网站PHP文件都存在恶意代码,就写了个简单的脚本清除。恶意代码示例...2015-10-23
  • jquery获取div距离窗口和父级dv的距离示例

    jquery中jquery.offset().top / left用于获取div距离窗口的距离,jquery.position().top / left 用于获取距离父级div的距离(必须是绝对定位的div)。 (1)先介绍jquery.offset().top / left css: 复制代码 代码如下: *{ mar...2013-10-13
  • Jquery 获取指定标签的对象及属性的设置与移除

    1、先讲讲JQuery的概念,JQuery首先是由一个 America 的叫什么 John Resig的人创建的,后来又很多的JS高手也加入了这个团队。其实 JQuery是一个JavaScript的类库,这个类库集合了很多功能方法,利用类库你可以用简单的一些代...2014-05-31
  • js识别uc浏览器的代码

    其实挺简单的就是if(navigator.userAgent.indexOf('UCBrowser') > -1) {alert("uc浏览器");}else{//不是uc浏览器执行的操作}如果想测试某个浏览器的特征可以通过如下方法获取JS获取浏览器信息 浏览器代码名称:navigator...2015-11-08
  • JS实现双击屏幕滚动效果代码

    本文实例讲述了JS实现双击屏幕滚动效果代码。分享给大家供大家参考,具体如下:这里演示双击滚屏效果代码的实现方法,不知道有觉得有用处的没,现在网上还有很多还在用这个特效的呢,代码分享给大家吧。运行效果截图如下:在线演...2015-10-30
  • JS日期加减,日期运算代码

    一、日期减去天数等于第二个日期function cc(dd,dadd){//可以加上错误处理var a = new Date(dd)a = a.valueOf()a = a - dadd * 24 * 60 * 60 * 1000a = new Date(a)alert(a.getFullYear() + "年" + (a.getMonth() +...2015-11-08
  • PHP开发微信支付的代码分享

    微信支付,即便交了保证金,你还是处理测试阶段,不能正式发布。必须到你通过程序测试提交订单、发货通知等数据到微信的系统中,才能申请发布。然后,因为在微信中是通过JS方式调用API,必须在微信后台设置支付授权目录,而且要到...2014-05-31
  • PHP常用的小程序代码段

    本文实例讲述了PHP常用的小程序代码段。分享给大家供大家参考,具体如下:1.计算两个时间的相差几天$startdate=strtotime("2009-12-09");$enddate=strtotime("2009-12-05");上面的php时间日期函数strtotime已经把字符串...2015-11-24