作者:AngryFox 分类: Uncategorized July 24th, 2011 暂无评论

中文转ascii码的php代码,utf-8也只是ascii的一种。后来中手册上找到了个,把他改为了批量转换,还增加了一个常用的ascii代码还原字符。

<?php
class ascii
{
        function decode($str) {
                preg_match_all("/(\d{2,5})/", $str,$a);
                $a = $a[0];
                foreach ($a as $dec){
                        if ($dec < 128) {
                                $utf .= chr($dec);
                        } else if ($dec < 2048) {
                                $utf .= chr(192 + (($dec - ($dec % 64)) / 64));
                                $utf .= chr(128 + ($dec % 64));
                        } else {
                                $utf .= chr(224 + (($dec - ($dec % 4096)) / 4096));
                                $utf .= chr(128 + ((($dec % 4096) - ($dec % 64)) / 64));
                                $utf .= chr(128 + ($dec % 64));
                        }
                }
                return $utf;
        }

        function encode($c){
                $len = strlen($c);
                $a = 0;
                while ($a < $len){
                        $ud = 0;
                        if (ord($c{$a})>=0 && ord($c{$a})<=127){
                                $ud = ord($c{$a});
                                $a += 1;
                        }else if (ord($c{$a})>=192 && ord($c{$a})<=223){
                                $ud = (ord($c{$a})-192)*64 + (ord($c{$a+1})-128);
                                $a += 2;
                        }else if (ord($c{$a})>=224 && ord($c{$a})<=239){
                                $ud = (ord($c{$a})-224)*4096 + (ord($c{$a+1})-128)*64 + (ord($c{$a+2})-128);
                                $a += 3;
                        }else if (ord($c{$a})>=240 && ord($c{$a})<=247){
                                $ud = (ord($c{$a})-240)*262144 + (ord($c{$a+1})-128)*4096 + (ord($c{$a+2})-128)*64 + (ord($c{$a+3})-128);
                                $a += 4;
                        }else if (ord($c{$a})>=248 && ord($c{$a})<=251){
                                $ud = (ord($c{$a})-248)*16777216 + (ord($c{$a+1})-128)*262144 + (ord($c{$a+2})-128)*4096 + (ord($c{$a+3})-128)*64 + (ord($c{$a+4})-128);
                                $a += 5;
                        }else if (ord($c{$a})>=252 && ord($c{$a})<=253){
                                $ud = (ord($c{$a})-252)*1073741824 + (ord($c{$a+1})-128)*16777216 + (ord($c{$a+2})-128)*262144 + (ord($c{$a+3})-128)*4096 + (ord($c{$a+4})-128)*64 + (ord($c{$a+5})-128);
                                $a += 6;
                        }else if (ord($c{$a})>=254 && ord($c{$a})<=255){ //error
                                $ud = false;
                        }
                        $scill .= "&#$ud;";
                }
                return $scill;
        }
}
?>
作者:AngryFox 分类: Uncategorized July 24th, 2011 暂无评论

Ajax实现页面无刷新发表评论
那么首先,我们需要一个基本的ajax开发框架,文件ajax.js就包含了这个框架,代码如下:

var http_request=false;
  function send_request(url){//初始化,指定处理函数,发送请求的函数
    http_request=false;
//开始初始化XMLHttpRequest对象
if(window.XMLHttpRequest){//Mozilla浏览器
  http_request=new XMLHttpRequest();
  if(http_request.overrideMimeType){//设置MIME类别
    http_request.overrideMimeType("text/xml");
  }
}
else if(window.ActiveXObject){//IE浏览器
  try{
   http_request=new ActiveXObject("Msxml2.XMLHttp");
  }catch(e){
   try{
   http_request=new ActiveXobject("Microsoft.XMLHttp");
   }catch(e){}
  }
    }
if(!http_request){//异常,创建对象实例失败
  window.alert("创建XMLHttp对象失败!");
  return false;
}
http_request.onreadystatechange=processrequest;
//确定发送请求方式,URL,及是否同步执行下段代码
    http_request.open("GET",url,true);
http_request.send(null);
  }
  //处理返回信息的函数
   function processrequest(){
   if(http_request.readyState==4){//判断对象状态
     if(http_request.status==200){//信息已成功返回,开始处理信息
   document.getElementById(reobj).innerHTML=http_request.responseText;
  }
  else{//页面不正常
   alert("您所请求的页面不正常!");
  }
   }
  }
   function checkfourm(obj){
    var f=document.fourm;
    var newfourm=f.newfourm.value;
    var username=f.username.value;
    var id=f.id.value;
    if(username==""){
           document.getElementById(obj).innerHTML="<img src=images/false.gif> <font color=red>您必须先登录!</font>";
     return false;
    }
    else if(newfourm==""){
     document.getElementById(obj).innerHTML="<img src=images/false.gif> <font color=red>您还没填写评论内容!</font>";
     return false;
    }
    else{
     document.getElementById(obj).innerHTML="正在发送数据...";
     send_request('sendnewfourm.php?username='+username+'&newfourm='+newfourm+'&id='+id);
     reobj=obj;
    }
   }

有一点ajax基础的通过注释,应该都可以看懂这段代码,我们可以看出,当我们开始发表评论的时候,在一个特定位置先显示:正在发送数据…。接着调用回调函数处理数据。

作者:AngryFox 分类: Uncategorized July 24th, 2011 暂无评论

伪造IP程序

<?php
$address = 'http://www.discuz.net/';//地址,必须有http://之类
$myip = '127.0.0.1';

ob_start();
$mtime = explode(' ', microtime());
$starttime = $mtime[1] + $mtime[0];

$onoff = (function_exists('ini_get')) ? ini_get('register_globals') : get_cfg_var('register_globals');

if($onoff != 1) {
        @extract($_POST, EXTR_SKIP);
        @extract($_GET, EXTR_SKIP);
}

$self = $_SERVER['PHP_SELF'];
$myaddress = 'http://'.$_SERVER['HTTP_HOST'].$self;

$comm = '';

if(isset($url) && $url) {
        $url = str_replace($address, '', $url);
}
/*
foreach($_POST as $key => $val) {
        if($comm == '') {
                $comm = $key.'='.rawurlencode($val);
        } else {
                $comm = $comm.'&'.$key.'='.rawurlencode($val);
        }
}
*/
$pcomm = '';
foreach($_POST as $key => $val) {
        if($pcomm == '') {
                $pcomm .= $key.''.urlencode($val);
        } else {
                $pcomm .= $pcomm.'&'.$key.'='.urlencode($val);
        }
}

foreach($_GET as $key => $val) {
        if($key != 'url') {
                if($comm == '') {
                        $comm = $key.'='.rawurlencode($val);
                } else {
                        $comm = $comm.'&'.$key.'='.rawurlencode($val);
                }
        }
}

if(!$url) {
        $url = $address;
} else {
        $url = $address.$url;
        if($comm) {
                if(strstr($url,'?')) {
                        $url = $url.'&'.$comm;
                } else {
                        $url = $url.'?'.$comm;
                }
        }
}

if($url) {
        $cookies= '';
        if(count($_COOKIE)) {
                foreach($_COOKIE as $cookie_name => $cookie_var) {
                        $cookies .= $cookies != '' ? '; '.$cookie_name.'='.$cookie_var : $cookie_name.'='.$cookie_var;
                }
        }

        $temp = @parse_url($url);
        $temp['port'] = isset($temp['port']) ? $temp['port'] : 80;
        $temp['path'] = isset($temp['path']) ? $temp['path'] : '/';
        $temp['file'] = substr($temp['path'], strrpos($temp['path'], '/')+1);
        $temp['dir'] = substr($temp['path'], 0, strrpos($temp['path'], '/'));
        $temp['base'] = $temp['scheme'].'://'.$temp['host'].($temp['port'] != 80 ? ':'.$temp['port'] : '').$temp['dir'];
        $temp['prev_dir'] = $temp['path'] != '/' ? substr($temp['base'], 0, strrpos($temp['base'], '/')+1) : $temp['base'].'/';
        $fp = @fsockopen($temp['host'], $temp['port'], $errno, $errstr, 30);
        if($fp) {
                if($_SERVER['REQUEST_METHOD'] != 'POST') {
                        @fputs($fp, "GET $temp[path]?$temp[query] HTTP/1.1\r\n");
                } else {
                        @fputs($fp, "POST $temp[path]?$temp[query] HTTP/1.1\r\n");
                }
                @fputs($fp, "Host: $temp[host]\r\n");
                @fputs($fp, "Accept: */*\r\n");
                @fputs($fp, "Referer: http://$temp[host]/\r\n");
                @fputs($fp, "Cookie: $cookies\r\n");
                @fputs($fp, "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\r\n");
                @fputs($fp, "via: 1.1 JEJE1:80 (squid/2.5.STABLE4-NT-CVS)\r\n");
                @fputs($fp, "X-Forwarded-For: $myip\r\n");
                if($_SERVER['REQUEST_METHOD'] == 'POST') {
                        @fputs($fp, "Content-Type: application/x-www-form-urlencoded\r\n");
                        @fputs($fp, "Content-Length: ".strlen($pcomm)."\r\n\r\n");
                        @fputs($fp, $pcomm);
                }
                @fputs($fp, "Connection: Close\r\n\r\n");

                while($str = @fread($fp, 4096)) {

                        if($str != "\r\n" && preg_match_all("#set-cookie:([^\r\n]*)#i", $str, $matches)) {
                                foreach($matches[1] as $cookie_info) {
                                        preg_match('#^\s*([^=;,\s]*)=?([^;,\s]*)#', $cookie_info, $match) && list(, $name, $value) = $match;
                                        preg_match('#;\s*expires\s*=([^;]*)#i', $cookie_info, $match) && list(, $expires) = $match;
                                        $expires = isset($expires) ? strtotime($expires) : false;
                                        $expires = (!is_numeric($expires) || time() > $expires) ? false : $expires;
                                        setcookie($name, $value, $expires);
                                }
                                $str = str_replace($matches[0], '', $str);
                        }
                       
                        $Content .= $str;
                }
                @fclose($fp);
                if(strpos($Content, 'Content-Type: text/html')) {
                        $Content = substr($Content, strpos($Content, 'Content-Type: text/html')+33);
                } else {
                        $Content = substr($Content, strpos($Content, chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a))+4);
                }
                $Content = str_replace(' href="',' href="'.$myaddress.'?url=',$Content);
                $Content = str_replace(' href=\'',' href=\''.$myaddress.'?url=',$Content);
                $Content = str_replace(' src="',' src="'.$myaddress.'?url=',$Content);
                $Content = str_replace(' src=\'',' src=\''.$myaddress.'?url=',$Content);
                $Content = str_replace(' src=image',' src="'.$myaddress.'?url=image',$Content);
                $Content = str_replace(' src=customavatars/',' src='.$myaddress.'?url=customavatars/',$Content);
                $Content = str_replace(' action="',' action="'.$myaddress.'?url=',$Content);
                $Content = str_replace(' url("',' url("'.$myaddress.'?url=',$Content);
                $Content = str_replace(' background="',' background="'.$myaddress.'?url=',$Content);
                $Content = str_replace(' url(\'',' url(\''.$myaddress.'?url=',$Content);
                $Content = str_replace($myaddress.'?url=javascript:','javascript:',$Content);
                $Content = str_replace(';url=',';url='.$myaddress.'?url=',$Content);
                echo $Content;
        }
}

?>
作者:AngryFox 分类: Uncategorized July 24th, 2011 暂无评论

搜索引擎蜘蛛列表.

搜索引擎蜘蛛列表

:robot/1.0=Neofonie.de
0.1_hseo(at)cs.rutgers.edu=Rutgers.edu
AbachoBOT (Mozilla compatible)=Crawler.de
AbachoBOT=Crawler.de
Abbr=http://www.suoxie.com
abcdatos_botlink=Abcdatos.com
abot/0.1 (abot; http://www.abot.com; abot@abot.com)=Abot.com
abot/0.1=Abot.com
About/0.1libwww-perl/5.47=About.com
accoona=Accoona.com
AcoiRobot=Acoi Picture Robot
Acoon Robot v1.50.001=Acoon.de
Acoon Robot v1.52=Acoon.de
Acoon Robot=Accon.de
ActiveWorlds/3.xx=ActiveWorlds.com
admin@crawler.de=Crawler.de
admin@maxbot.com=maxbot.com
ADSARobot=ADSARobot
AESOP_com_SpiderMan=Aesop.com
agadine/1.x.x=Agada.de
Agent-admin/=Daum.net
ah-ha.com crawler (crawler@ah-ha.com)=Ah-ha.com
ah-ha.com crawler=Ah-ha.com
AIBOT/2.1=21Seek.com
aipbot/1.0 (aipbot; http://www.aipbot.com; aipbot@aipbot.com)=NameProtect.com
aipbot/1.0=NameProtect.com
aipbot=NameProtect.com
Aladin/3.324=Aladin.de
Aleksika Spider/1.0=Aleksika.de
AlkalineBOT/1.3=Vestris.com
AlkalineBOT/1.4=Vestris.com
AlkalineBOT=AlkalineBOT
Allesklar/0.1 libwww-perl/5.46=Allesklar.de
AltaVista-Intranet=Altavista.co.uk
AmfibiBOT=Amfibi.com
Amiga-AWeb/3.4.167SE=AWeb.com
amzn_assoc=Amazon.com
AnswerChase PROve x.0=AnswerChase.com
AnswerChase x.0=AnwserChase.com
AnswerChase=AnswerChase.com
Antibot=AntiSeach.net
antibot-V1.1.5/i586-linux-2.2=AntiSeach.net
AnzwersCrawl/2.0=Anzwers
A-Online Search=Jet2Web.com
Aport=Aport.ru
appie 1.1=Walhello.com
appie=Walhello.com
arachnoidea@euroseek.net=Euroseek.net
Arachnoidea=Euroseek.com
Aranha=Girafa.com
ArchitectSpider=Excite.com
archive.org_bot=Archive.org
archive_org=Archive.org
ask jeeves=Ask Jeeves
ask.24x.info=Ask.24x.info
ASPSeek/1.2.5=ASPSeek.org
ASPseek/1.2.9d=ASPSeek.com
ASPSeek/1.2.x=ASPSeek.org
ASPSeek/1.2.xa=ASPSeek.org
ASPseek/1.2.xx=ASPseek.org
ASPSeek/1.2.xxpre=ASPSeek.org
ASPSeek=ASPSeek.org
asterias/2.0=SingingFish.com
Asterias=SingingFish.com
AtlocalBot/1.1 +(http://www.atlocal.com/local-web-site-owner.html)=Atlocal.com
AtlocalBot=Atlocal.com
Atomz/1.0=Atomz.com
Atomz=Atomz.com
Augurfind=Augurnet.ch
augurnfind V-1.x=Augurnet.ch
autohttp=Elsop.com
AV Fetch 1.0=Altavista.com
AVSearch=Altavista.com
AVSearch-3.0=Altavista.com
AxmoRobot=Axmo.com
Baiduspider+=Baidu.com
BaiDuSpider=Baidu.com
BanBots/1.2=Banbots.com
BarraHomeCrawler=BarraHome.com
bdcindexer_2.6.2=Business.com
BDFetch=Brandimensions.com
BDNcentral Crawler v2.3=Bdncentral.com
beautybot/1.0=Cosmoty.com
BigCliqueBOT/1.03-dev=BigClique.com
Bilbo/2.3b-UNIX=Biblo Bot
BlackWidow=BlackWidow Bot
Blaiz-Bee/1.0 (+http://www.blaiz.net)=Blaiz.net
Blaiz-Bee/1.0=Blaiz.net
BlitzBOT@tricus.net (Mozilla compatible)=Blitzsuche.rp-online.de
BlitzBOT@tricus.net=Blitzsuche.rp-online.de
Blog=http://www.5iya.com/blog
BlogBot/1.x=Blogdex.net
BlogBot=Blogdex.net
Bloglines Title Fetch/1.0 (http://www.bloglines.com)=Bloglines.com
blogWatcher_Spider/0.1=Blogwatcher.pi.titech.ac.jp
BlogzIce/1.0 (+http://icerocket.com; rhodes@icerocket.com)=IceRocket.com
BlogzIce/1.0 +http://www.icerocket.com/=IceRocket.com
BlogzIce/1.0=IceRocket.com
boitho.com-dc/0.xx=Boitho.com
boitho.com-robot/1.x=Boitho.com
BSDSeek/1.0=Inktomi.com
BullsEye=Intelliseek.com
bumblebee@relevare.com=Relevare.com
Buscaplus Robi/1.0=Buscaplus.com
Buscaplus Robi=Buscaplus.com
CanSeek/=Cansee.ca
ChristCRAWLER 2.0=Christcrawler.com
ChristCRAWLER=Christcrawler.com
CipinetBot=Cipinet.com
citenikbot/=Cenik.co.uk
ClariaBot/1.0=Searchscout.com
Claymont.com=Claymont.com
CLIPS-index=Cips-index.imag.fr
Clushbot/3.3-BinaryFury (+http://www.clush.com/bot.html)=Clush.com
Clushbot/3.3-BinaryFury=Clush.com
Combine/x.0=Combine Bot
Computer_and_Automation_Research_Institute_Crawler=Research Bot
contact/jylee@kies.co.kr=Kies.co.kr
Convera Internet Spider V6.x=Convera.com
cosmos/0.8_(robot@xyleme.com)=Xyleme.com
cosmos/0.9_(robot@xyleme.com)=Xyleme.com
cosmos=Xyleme.com
C-PBWF-ip3000.com-crawler=IP3000.com
CrawlConvera0.1=Converna.net
Crawler (cometsearch@cometsystems.com)=Findwhat.com
Crawler admin@crawler.de=Crawler.de
Crawler V 0.2.x admin@crawler.de=Crawler.de
crawler@alexa.com=Alexa.com
crawler@brainbot.com=Brainbot.com
crawler@fast.no=Alltheweb.com
Crawler=Crawler.de
CrawlerBoy Pinpoint.com=Pinpoint.com
CrawlerBoy=Pinpoint.com
CrocCrawler= CrocCrawler.com
Custom Spider www.bisnisseek.com /1.0=Bisnisseek.com
DaAdLe.com ROBOT/=Daadle.com
DataparkSearch/4.xx=DataparkSearch.com
DaviesBot/1.7=Wholeweb.net
DaviesBot=Wholeweb.net
dbDig=Prairielandconsulting.com
DBrowse 1.4b=DBrowse Bot
DBrowse 1.4d=DBrowse Bot
dCSbot/1.1=Openmarket.com
DeepIndex=DeepIndex.com
DeepIndexer.ca=DeepIndex.com
deepweb=Deepweb.com
Demo Bot DOT 16b= Btopenworld.com
DiaGem/=Skyrocket.gr.jp
DiaGem/1.1 (http://www.skyrocket.gr.jp/diagem.html)=Skyrocket.gr.jp
DiaGem/1.1=Skyrocket.gr.jp
Diamond/1.0=Searchscout.com
Digger/1.0 JDK/1.3.0rc3=Diggit.com
Digimarc WebReader=Digimarc.com
DigOut4U=Arisem.com
DIIbot/1.2=Digital-Integrity.com
DIIbot=Digital-Integrity.com
DittoSpyder=Ditto.com
dloader(NaverRobot)/=Naver.com
dtSearchSpider=Dtsearch.com
Dumbot(version 0.1 beta - dumbfind.com)=Dumbfind.com
Dumbot(version 0.1 beta)=Dumbfind.com
dumrobo(NaverRobot)/=Naver.com
EARTHCOM.info/1.4beta=Earthcom.info
EasyDL/3.02=Keywen.com
EasyDL/3.03=Keywen.com
EasyDL/3.04=Keywen.com
EasyDL/3.xx http://keywen.com/Encyclopedia/Bot=Keywen.com
EasyDL/3.xx=Keywen.com
EchO!/2.0=Voila.com
egothor/3.0a (+http://www.xdefine.org/robot.html)=Xdefine.com
egothor/3.0a=Xdefine.com
EgotoBot/4.8=Egoto.com
Enterprise_Search/1.0.xxx=Innerprise.net
Enterprise_Search/1.0=Innerprise.net
erik@malfunction.org=Malfunction.org
EroCrawler=Erocrawler.com
ES.NET_Crawler/2.0=Innerprise.net
eseek-larbin_2.6.2=Exactseek.com
ESISmartSpider=Travel-Finder.com
ExactSeek Crawler/0.1=Exactseek.com
exactseek-crawler-2.63=Exactseek.com
Exalead NG/MimeLive Client=Exabot.com
Excalibur Internet Spider V6.5.4=Excalib.com
ExperimentalHenrytheMiragoRobot=Mirago.co.uk
EyeCatcher (Download-tipp.de)/1.0=Download-tipp.de
EyeCatcher=Download-tipp.de
EZResult=Ezresults.com
Fast Crawler Gold Edition=Alltheweb.com
FAST Data Search Crawler=Alltheweb.com
FAST Enterprise Crawler 6 (Experimental)=Alltheweb.com
FAST Enterprise Crawler 6 used by FAST (FAST)=Alltheweb.com
FAST Enterprise Crawler 6 used by FAST=Alltheweb.com
FAST Enterprise Crawler 6=Alltheweb.com
FAST Enterprise Crawler/6 (www.fastsearch.com)=Alltheweb.com
FAST Enterprise Crawler/6=Alltheweb.com
FAST FirstPage retriever (compatible; MSIE 5.5; Mozilla/4.0)=Alltheweb.com
FAST FirstPage retriever=Alltheweb.com
Fast PartnerSite Crawler=Alltheweb.com
FastCrawler 3.0.1 (crawler@1klik.dk)=Alltheweb.com
FastCrawler 3.0.1=Alltheweb.com
FAST-WebCrawler/2.2.10=Altheweb.com
FAST-WebCrawler/2.2.6=Altheweb.com
FAST-WebCrawler/2.2.7=Altheweb.com
FAST-WebCrawler/2.2.8=Altheweb.com
FAST-WebCrawler/3.2 test=Altheweb.com
FAST-WebCrawler/3.2=Altheweb.com
FAST-WebCrawler/3.3=Altheweb.com
FAST-WebCrawler/3.4/Nirvana=Altheweb.com
FAST-WebCrawler/3.4/PartnerSite=Altheweb.com
FAST-WebCrawler/3.5=Altheweb.com
FAST-WebCrawler/3.6/FirstPage=Altheweb.com
FAST-WebCrawler/3.6=Altheweb.com
FAST-WebCrawler/3.7/FirstPage=Altheweb.com
FAST-WebCrawler/3.7=Altheweb.com
FAST-WebCrawler/3.8/Fresh=Altheweb.com
FAST-WebCrawler/3.8=Altheweb.com
FAST-WebCrawler/3.x Multimedia (mm dash crawler at fast dot no)=Altheweb.com
FAST-WebCrawler/3.x Multimedia=Altheweb.com
FAST-WebCrawler=Alltheweb.com
Faxobot/1.0=FaXo.com
Felix - Mixcat Crawler=Mixcat.com
Felix=Mixcat.com
FFC Trap Door Spider=Frequentfinders.com
fido/1.0 Harvest/1.4.pl2=Planet Search
FileExtension=http://www.kuozhanming.com
FinaleRobot=expressus.com
FindAnISP.com_ISP_Finder_v99a=FindAnISP.com
FineBot=Finesearch.com
Firefly/1.0 (compatible; Mozilla 4.0; MSIE 5.5)=Fireball.de
Firefly/1.0=Fireball.de
FlickBot 2.0 RPT-HTTPClient/0.3-3=DivX.com
Fluffy the spider=SearchHippo.com
Flunky=Metacarta.com
Francis/1.0 (francis@neomo.de http://www.neomo.de/)=Neomo.de
Francis/1.0=Neomo.de
FreeFind.com-SiteSearchEngine/1.0=Freefind.com
FyberSearch=Fybersearch.com
FyberSpider=Fybersearch.com
Gagglebot=Gagglebot
GAIS Robot/1.0B2=Seed.net.tw
Gaisbot/3.0+=Seed.net.tw
Gaisbot/3.0=Seed.net.tw
GalaxyBot/1.0 (http://www.galaxy.com/galaxybot.html)=Galaxy.com
GalaxyBot/1.0=Galaxy.com
GalaxyBot=Galaxy.com
GammaSpider/1.0=Gammasite.com
gazz/1.0=Infobee.ne.jp
gazz@nttrd.com=Infobee.ne.jp
Geckobot=Geckobot.com
geckobot=Geckobot.com
GenCrawler=Gendoor.com
generic_crawler/01.0217/=Cmu.edu
GentleSpider=Research.att.com
GeonaBot=Geona.com
GigaBaz=Brainbot.com
GigaBazVStheWeb=Brainbot.com
GigaBlast=Gigablast.com
Gigabot/1.0=Gigablast.com
Gigabot=Gigablast.com
GigabotSiteSearch/2.0 (sitesearch.gigablast.com)=Gigablast.com
GigabotSiteSearch/2.0=Gigablast.com
Giskard=oralco.com
GNODSPIDER=Gnod.net
Goblin/0.9 (http://www.goguides.org/)=Goguides.org
Goblin/0.9.x (http://www.goguides.org/goblin-info.html)=Goguides.org
Goblin/0.9.x=Goguides.org
Goblin/0.9=Goguides.org
GoForIt.com=Goforit.com
Goofer/0.2=Wanadoo.fr
Google=Google.com
Googlebot/1.0=Google.com
Googlebot/2.1= Google.com
Googlebot/Test=Google.com
googlebot@googlebot.com=Google.com
Googlebot=Google.com
Googlebot-Image/1.0=Google.com Image Bot
GrigorBot 0.8=Grigor.biz
grub crawler(http://www.grub.org)=Grub.com
grub-client=Grub.org
gsa-crawler (Enterprise; GID-01422; jplastiras@google.com)=Google.com
gsa-crawler (Enterprise; GID-01742;gsatesting@rediffmail.com)=Google.com
gsa-crawler=Google.com
Gulliver/1.2=Northernlight.com
Gulliver/1.3=Northernlight.com
Gulliver=Northernlight.com
Gulper Web Bot 0.2.4=Gulper Bot
Gulper Web Bot=Gulper Bot
Hatena Antenna/0.4 (http://a.hatena.ne.jp/help#robot)=a.hatena.ne.jp
Hatena Antenna/0.4=a.hatena.ne.jp
HeinrichderMiragoRobot=Mirago.de
HenrytheMiragoRobot=Mirago.co.uk
HenryTheMiragoRobot=Mirago.co.uk
Hippias/0.9 Beta= Hippias Bot
holmes/x.x=Morfeo.centrum.cz
HomePageSearch(hpsearch.uni-trier.de)=Hpsearch.uni-trier.de
Homerbot: www.homerweb.com=Homerweb.com
Homerbot=Homerweb.com
htdig/3.1.6 (http://computerorgs.com)=Computerorgs.com
htdig/3.1.x (root@localhost)=Htdig.org
htdig/3.1.x=Htdig.org

http://www.abcdatos.com/botlink/=Abcdatos.com

Hubater=Hubat.com
ia_archiver/1.6=Archive.org
ia_archiver=Archive.org
IAArchiver-1.0=Archive.org
icsbot-0.1=Icseoul.org
ideare - SignSite/1.x=Ideare.com
Ideare - SignSite=Ideare.com
IlTrovatore-Setaccio (+http://www.iltrovatore.it)=Iltrovatore.it
Iltrovatore-Setaccio/0.3-dev=Iltrovatore.it
IlTrovatore-Setaccio/1.2=Iltrovatore.it
iltrovatore-setaccio/1.2-dev=Iltrovatore.it
IlTrovatore-Setaccio=Iltrovatore.it
IncyWincy=Incywincy.com
IndexTheWeb.com Crawler7=IndexTheWeb.com
Inet library=Inetlibrary.com
info@searchhippo.com=Searchhippo.com
InfoFly/1.0 (http://www.versions-project.org/)=Versions-project.org
InfoFly/1.0= Versions-project.org
InfoSeek Sidewinder/0.9=Infoseek.com
InfoSeek Sidewinder/1.0A= Infoseek.com
InfoSeek Sidewinder/1.1A= Infoseek.com
Infoseek SideWinder/1.45 (Compatible; MSIE 10.0; UNIX)= Infoseek.com
Infoseek SideWinder/1.45= Infoseek.com
Infoseek SideWinder/2.0B (Linux 2.4 i686)= Infoseek.com
Infoseek SideWinder/2.0B= Infoseek.com
InfoSeek Sidewinder=infoseek.com
Inktomi Search=Yahoo.com
Inktomi=Yahoo.com
InnerpriseBot/1.0 (http://www.innerprise.com/)=Innerprise.net
InnerpriseBot/1.0=Innerprise.net
InsumaScout=InsumaScout
Internet Ninja 6.0=Dti.ne.jp
InternetSeer.com= InternetSeer.com
InternetSeer=InternetSeer
InternetSeer=InternetSeer.com
ip3000.com=ip3000.com
ip3000.com-crawler=ip3000.com
IPiumBot laurion(dot)com=Laurion.com
ipiumBot=Laurion.com
Iron33=Verno.ueda.info.waseda.ac.jp
Jabot/6.x (http://odin.ingrid.org/)=Ingrid.org
Jabot/6.x=Ingrid.org
Jabot/7.x.x (http://odin.ingrid.org/)=Ingrid.org
Jabot/7.x.x=Ingrid.org
Jack=Domanova.co.uk
jan.gelin@av.com=Altavista.co.uk
jeeves=Ask Jeeves
Jetbot/1.0=Jeteye.com
JoocerBot=Joocer.com
Jyxobot/x=Jyxo.cz
Katriona=Katriona
KE_1.0/2.0 libwww/5.2.8=Voila.fr
Kenjin Spider=Kenjin.ne.jp
KIT_Fireball/2.0=Fireball.de
KIT-Fireball/2.0 (compatible; Mozilla 4.0; MSIE 5.5)=Fireball.de
KIT-Fireball/2.0=Fireball.de
KIT-Fireball=Fireball.de
Knowledge.com/0.x=Knowledge.com
Kototoi/0.1=s.u-tokyo.ac.jp
kuloko-bot/0.2=Kuloko.com
kuloko-bot/0.x=Kuloko.com
Kulokobot=Kuloko.com
kulturarw3/0.1=National Library of Sweden
LEIA/3.01pr (LEIAcrawler; [SNIP])=Gseek.com
LEIA=Gseek.com
LexiBot=Lexibot.com
LNSpiderguy=Lexis-nexis.com
Look.com=Look.com
lwp-trivial/1.27=Search4free.com
lwp-trivial/1.34=Search4free.com
Lycos_Spider_(T-Rex)/3.0=Lycos.com
Lycos_Spider_(T-Rex)=Lycos.com
lycos=Lycos.com
Mackster( http://www.ukwizz.com )=Ukwizz.com
Mackster=Ukwizz.com
Mag-Net=Wind.it
mailto:webcraft@bea.com=Beasys.com
mammoth/1.0 (+http://www.sli-systems.com/)=Sli-Systems.com
mammoth/1.0=Sli-Systems.com
MantraAgent=Looksmart.com
mapper@teradex.com=Mapper.teradex.com
Mariner/5.1b [de] (Win95; I ;Kolibri gncwebbot)=Kolibri.de
Mariner/5.1b= Kolibri.de
Martini=Looksmart.com
Marvin v0.3=Marvin Bot
marvin/infoseek=Webseek.de
team@webseek.de[/email]=Webseek.de
Mata Hari/2.00=Lexibot.com
MediaCrawler-1.0 (Experimental)=Mediacrawler.de
MediaCrawler-1.0=Mediacrawler.de
Mediapartners-Google/2.1 (+http://www.googlebot.com/bot.html)=Google.com Adsense
Mediapartners-Google/2.1=Google.com Adsense
MediaSearch/0.1=Www.fi
MegaSheep v1.0 (www.searchuk.com internet sheep)=SearchUK.com
MegaSheep v1.0=SearchUK.com
Mercator=Altavista.com
Mercator=Altavista.com
Mercator-1.x=Altavista.com
Mercator-2.0=Altavista.com
Mercator-Scrub-1.1=Altavista.com
metabot=Metabot
Metaspinner/0.01=Meta-Spinner.de
MFC_Tear_Sample=Microsoft.com
MicrosoftPrototypeCrawler=Microsoft.com
Minibot=Minibot
MiracleAlphaTest=Nec.co.jp
MnogoSearch/3.2.xx=mNoGoSearch.org
moget/2.0=Goo.ne.jp
moget/2.1 (moget@goo.ne.jp)=Goo.ne.jp
moget/2.1=Goo.ne.jp
moget@goo.ne.jp=Goo.ne.jp
Mole2/1.0=Intags.de
Morris - Mixcat Crawler (+http://mixcat.com)=Mixcat.com
Morris - Mixcat Crawler=Mixcat.com
Morris=Mixcat.com
Mouse-House/7.4=Spidermonkey.ca
mozDex/=Mozdex.com
mozDex/0.04-dev=Mozdex.com
Mozilla (Mozilla@somewhere.com)=Somewhere.com
Mozilla/2.0 (compatible; Ask Jeeves)=Ask Jeeves
Mozilla/2.0 (compatible; EZResult -- Internet Search Engine)=DirectHit.com
Mozilla/3.0 (compatible; MuscatFerret/1.5.4; claude@euroferret.com)=Euroferret.com
Mozilla/3.0 (compatible; MuscatFerret/1.5; olly@muscat.co.uk)=Euroferret.com
Mozilla/3.0 (compatible; MuscatFerret/1.6.x; claude@euroferret.com)=Euroferret.com
Mozilla/3.01 (Compatible; Links2Go Similarity Engine)=Links2go.com
Mozilla/4.0 (compatible; FastCrawler3, fastcrawler3@fast.no[/email])=AllTheWeb.com
Mozilla/4.0 (compatible; grub-client-2.x)=Grub.org
Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) TrueRobot; 1.5=Echo.com
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT; MS Search 4.0 Robot)=MSN.com
Mozilla/4.0 (compatible; SpeedySpider; www.entireweb.com)=EntireWeb.com
Mozilla/4.0 (compatible; www.galaxy.com)=Galaxy.com
Mozilla/4.0 [en] (Ask Jeeves Corporate Spider)=Ask Jeeves
Mozilla/4.0(compatible; Zealbot 1.0)=LookSmart.com
mozilla/5.0 (compatible; genevabot +http://www.healthdash.com)=HealthDash.com
Mozilla/5.0 (wgao@genieknows.com)=GenieKnows.com
Mozilla/5.0 wgao@genieknows.com=GenieKnows.com
Mozilla/5.0 (compatible; Yahoo! Slurp;)=Yahoo.com
MP3Bot=mp3bot.de
MSN=MSN.com
MSNBOT/0.1=MSN.com
msnbot=MSN.com
MultiText/0.1=MultiText
MultiText=MultiText
MuscatFerret=Webtop.com
NationalDirectoryAddURL/1.0=NationalDirectory.com
NationalDirectory-SuperSpider=Nationaldirectory.com
NationalDirectory-WebSpider/1.3=NationalDirectory.com
Nazilla=Websmostlinked.com
NEC Research Agent=NEC Research Agent
NetCruiser=NetCruiser
NetResearchServer(http://www.look.com)=Look.com
NetResearchServer=Look.com
NetZippy=Netzippy.com
NextopiaBOT=Nextopia.com
NG/1.0=Exabot.com
Noago Spider=Noago.com
NP/0.1 (NP; http://www.nameprotect.com; npbot@nameprotect.com)=NameProtect.com
NP/0.1=NameProtect.com
NPBot=NameProtect.com
NPBot-1/2.0=NameProtect.com
nttdirectory_robot=Navi.ocn.ne.jp
Nutch=Nutch.org
NutchCVS/0.0x-dev=Nutch.org
NutchOrg/0.0x-dev=Nutch.org
NutchOrg=Nutch.org
NZBot=NavigationZone.com
ObjectsSearch/0.01=ObjectsSearch.com
ObjectsSearch/0.0x=ObjectsSearch.com
oBot ((compatible;Win32))=Cobion.com
oBot=Cobion.com
OliverPerry=Claymont.com
OntoSpider/1.0 libwww-perl/5.65=Ontospider.i-n.info
OntoSpider/1.0=Ontospider.i-n.info
OntoSpider=Ontospider.i-n.info
Openbot/=Openfind.com.tw
Openbot/3.0+=Openfind.com.tw
Openbot/3.0=Openfind.com.tw
Opencola=Opencola.com
Openfind piranha=Openfind.com
Openfind Robot/1.1A2=Openfind.com.tw

http://www.5iya.com

OpenTextSiteCrawler/2.9.2=Opentext.net
Oracle Ultra Search=Oracle.com
Oxxbot1=Oxxfordinfo.com
Pansophica=Pansophica
ParaSite/1.0b (http://www.ianett.com/parasite/)=Ianett.com
ParaSite/1.0b=Ianett.com
pd02_1.0.0 pd02_1.0.0@dzimi@post.sk=Post.sk
peerbot=Peerbot.com
Phoaks=Phoaks
phortse@hanmail.net=Daum.net
PICgrabber=PICgrabber
PicoSearch/=PicoSearch.com
PicoSearch/1.0=PicoSearch.com
PictureOfInternet=PictureOfInternet
PintaSpider=PintaSpider
pipeLiner/0.10=Pipeline-Search.com
pipeLiner=Pipeline-Search.com
Pita=Pita Bot
Pizilla++ ver 2.45=He.net
PJspider/3.0 (pjspider@portaljuice.com; http://www.portaljuice.com)=Portaljuice.com
PJspider/3.0=Portaljuice.com
PJspider=Portaljuice.com
polybot 1.0 (http://cis.poly.edu/polybot/)= PolyBot
polybot 1.0=PolyBot
PolyBot=PolyBot
Pompos/1.x http://dir.com/pompos.html=Dir.com
Pompos/1.x pompos@iliad.fr=Iliad.fr
Pompos/1.x=Free.fr
Popdexter/1.0=Popdex.com
PortalBSpider/2.0 (spider@portalb.com)=Portalb.com
PortalBSpider/2.0=Portalb.com
Project XP5 [2.03.07-111203]= XP5 Bot
Project XP5=XP5 Bot
PROve AnswerBot 4.0=Answerchase.com
psbot/0.1 (+http://www.picsearch.com/bot.html)=Picsearch.com
psbot/0.1=Picsearch.com
psbot=Picsearch.com
Qango.com Web Directory (http://www.qango.com/)=Qango.com
Qango.com Web Directory= Qango.com
QPCreep Test Rig ( We are not indexing, just testing ) =Quepasa.com
QPCreep Test Rig=Quepasa.com
QuepasaCreep ( crawler@quepasacorp.com )=Quepasa.com
QuepasaCreep v0.9.1x=Quepasa.com
QuepasaCreep=Quepasa.com
QueryN Metasearch=Queryn.com
rabaz (rabaz at gigabaz dot com)=Brainbot.com
Rabaz=Brainbot.com
RaBot=Daum.net
ramBot xtreme x.x=Intersearch.de
Reaper [2.03.10-031204] (http://www.sitesearch.ca/reaper/)=Sitesearch.ca
Reaper [2.03.10-031204]=Sitesearch.ca
Reaper/2.0x (+http://www.sitesearch.ca/reaper)=Sitesearch.ca
Reaper/2.0x=Sitesearch.ca
Reaper=Sitesearch.ca
roach.smo.av.com-1.0=Altavista.com
roach.smo.av.com-1.0=Altavista.com
RoboCrawl (www.canadiancontent.net)=CanadianContent.net
RoboCrawl=CanadianContent.net
Robot/www.pj-search.com=PJ-Search.com
Robot@SuperSnooper.Com=SuperSnooper.com
robot@xyleme.com=Xyleme.com
master@expressus.com[/email]=Expressus.com
response@openfind.com.tw[/email]=Openfind.com.tw
Robozilla/1.0=Dmoz.org
Rotondo/3.1 libwww/5.3.1=Qualigo.de
ru-robot=Rutgers.edu
Scooter/1.0 scooter@pa.dec.com=Altavista.com
Scooter/1.0=Altavista.com
Scooter/1.1 (custom)=Altavista.com
Scooter/2.0 G.R.A.B. V1.1.0 =Altavista.com
Scooter/2.0 G.R.A.B. X2.0=Altavista.com
Scooter/3.3.QA.pczukor=Altavista.com
Scooter/3.3.vscooter=Altavista.com
Scooter/3.3_SF=Altavista.com
Scooter/3.3=Altavista.com
Scooter_bh0-3.0.3=Altavista.com
Scooter_trk3-3.0.3=Altavista.com
Scooter=Altavista.com
Scooter2_Mercator_3-1.0=Altavista.com
Scooter2_Mercator_x-x.0=Altavista.com
Scooter-3.0.EU=Altavista.com
Scooter-3.0.FS=Altavista.com
Scooter-3.0.HD=Altavista.com
Scooter-3.0.VNS=Altavista.com
Scooter-3.0QI=Altavista.com
Scooter-3.2.BT=Altavista.com
Scooter-3.2.DIL=Altavista.com
Scooter-3.2.EX=Altavista.com
Scooter-3.2.JT=Altavista.com
Scooter-3.2.NIV=Altavista.com
Scooter-3.2.SF0=Altavista.com
Scooter-3.2.snippet=Altavista.com
Scooter-3.2=Altavista.com
Scooter-3.3dev=Altavista.com
Scooter-ARS-1.1=Altavista.com
Scooter-ARS-1.1-ih=Altavista.com
scooter-venus-3.0.vns=Altavista.com
Scooter-W3.1.2=Altavista.com
Scooter-W3-1.0=Altavista.com
Scrubby/=Scrubtheweb.com
search.at V1.2=Search.at
search.ch V1.4.2=Search.ch
search.ch V1.4=Search.ch
SearchExpress Spider0.99=SearchExpress.com
Searchit-Now Robot/2.2 (+http://www.searchit-now.co.uk)=Searchit-now.co.uk
Searchit-Now Robot/2.2=Searchit-now.co.uk
SearchSpider.com/1.1=Searchspider.com
Searchspider/=Searchspider.com
Searchspider/1.2=Searchspider.com
sebastien.ailleret@inria.fr=Inria.fr
Seeker.lookseek.com=Lookseek.com
SeznamBot/1.0 (+http://fulltext.seznam.cz/)=Seznam.cz
SeznamBot/1.0=Seznam.cz
Shark=Openfind.com
sherlock_spider=Sherlock.com.cn
SightQuestBot/=Sightquest.com
SiteSpider +(http://www.SiteSpider.com/)=Sitespider.com
SiteSpider=Sitespider.com
SiteXpert=Xtreeme.com
Skampy/0.9.x= Skaffe.com
Skimpy/0.x=Skaffe.com
Slarp/0.1=Only.com
Slider_Search_v1-de=Slider.com
Slurp.so/1.0= Yahoo.com
Slurp/2.0j=Yahoo.com
Slurp/2.0-KiteHourly=Yahoo.com
Slurp/2.0-OwlWeekly=Yahoo.com
Slurp/3.0-AU=Yahoo.com
slurp@inktomi.com=Yahoo.com
slurp@inktomi= Yahoo.com
Slurp=Yahoo.com
SlySearch/1.0=Turnitin.com
SlySearch/1.x=Turnitin.com
SlySearch=Turnitin.com
speedfind ramBot xtreme 8.1=Speedfind.de
speedfind ramBot xtreme=Speedfind.de
Speedy Spider (Beta/x.x; speedy@entireweb.com)=EntireWeb.com
Speedy Spider=EntireWeb.com
Speedy_Spider (http://www.entireweb.com)=EntireWeb.com
Speedy_Spider=EntireWeb.com
Spida/0.1=Only.com
Spider TraficDublu=Traficdublu.ro
Spider/maxbot.com admin@maxbot.com=Maxbot.com
Spider/maxbot.com=Maxbot.com
spider@aeneid.com=Yahoo.com
Spider_Monkey/=Spidermonkey.ca
spider_monkey=Spidermonkey.ca
SpiderMonkey/7.x=Spidermonkey.ca
Sqworm/2.9.81-BETA (beta_release; 20011102-760; i686-pc-linux-gnu)=Aol.com
Sqworm=Aol.com
Steeler/1.x (http://www.tkl.iis.u-tokyo.ac.jp/~crawler/)=Steeler Bot
Steeler/1.x=Steeler Bot
Steeler=Steeler Bot
Suchbot=Suchbot.de
Suchknecht.at-Robot=Suchknecht.at
robot@super.navi.ocn.ne.jp[/email]=Navi.ocn.ne.jp
support@canseek.ca=Canseek.ca
Surfnomore Spider v1.1=Surfnomore.com
SwissSearch V1.2=SwissSearch
SynoBot=Synomia.fr
TaWWWantula=TaWWWantula
teoma_admin@hawkholdings.com=Teoma.com
teoma_agent1=Teoma.com
TeraCrawl=TeraCrawl
Teradex_Mapper=Mapper.teradex.com
The Informant=The Informant
TheSuBot/0.1 (www.thesubot.de)=TheSuBot.de
TheSuBot/0.1=TheSuBot.de
thumbshots-de-Bot (Version: 1.02, powered by www.thumbshots.de)=ThumbShots.de
thumbshots-de-Bot=ThumbShots.de
Toutatis 2.5-2=Hoppa.com
Toutatis 3.3 (hoppa.com)=Hoppa.com
Toutatis 4-19.6 (hoppa.com)=Hoppa.com
TurnitinBot/x.x (http://www.turnitin.com/robot/crawlerinfo.html)=Turnitin.com
TurnitinBot/x.x=Turnitin.com
TurnitinBot=Turnitin.com
Tutorial Crawler=Tutorgig.com
Tv<nn>_Merc_resh_26_1_D-1.0=Altavista.com
Tv<nn>_Merc_resh_26_1_D-1.0=Altavista.com
TygoBot=Tygo.com
UCmore=Ucmore.com
UdmSearch=Mnogosearch.org
UK Searcher Spider=Uksearcher.co.uk
Ultraseek=Infoseek.com
unlostBot=Unlost.com
updated/0.1beta=Updated.com
URLBlaze=Urlblaze.net
UrlScope=UrlScope
Vagabondo/1.x MT (webagent@wise-guys.nl)=Wise-guys.nl
Vagabondo/2.0 MT (webagent at wise-guys dot nl)=Wise-guys.nl
Vagabondo/2.0 MT (webagent@NOSPAMwise-guys.nl)=Wise-guys.nl
Vagabondo/2.0 MT=Wise-guys.nl
Vagabondo=Wise-guys.nl
vspider=Verity.com
webbandit/4.xx.0=WebBandit
Webbandit=WebBandit
Webclipping.com=WebClipping.com
webcollage/1.xx=WebCollage.com
webcollage=WebCollage.com
WebCompass=WebCompass
WebCrawler/3.0 Robot libwww/5.0a=WebCrawler
WebCrawler-AddURL/2.0=WebCrawler
WebFindBot(http://www.web-find.com)=Web-find.com
WebFindBot=Web-find.com
WebGather=WebGather
WebGenie=WebGenie
webmaster@intags.de=Intags.de
whatUseek_winona/3.0=Whatuseek.com
whatuseek=Whatuseek.com
WhizBang! Lab=Whizbanglabs.com
WIRE WebRefiner=Wire.co.uk
wisenutbot=Looksmart.com
WSCbot=WorldSearchCenter.com
www.inktomisearch.com=Yahoo.com
www.WebWombat.com.au=Webwombat.com.au
YahooSeeker/CafeKelsa=Yahoo.com
Yandex=Yandex.com
Yellopet-Spider=YellowPet.com
YottaShopping_Bot/4.12=YottaShopping.com
Zao/0.1 (http://www.kototoi.org/zao/)=Zao Bot
Zao/0.1=Zao Bot
Zao/0.2=Zao Bot
Zao-Crawler=Zao Bot
zerxbot/Version 0.6 libwww-perl/5.79=Zerx.com
Zippy v2.0 - Zippyfinder.com=Zippyfinder.com
ZyBorg=Wisenut.com
作者:AngryFox 分类: Uncategorized July 24th, 2011 暂无评论

欺骗W3C的功能
下面是一段PHP函数,可以加到自己的PHP程序里面然后调用这个函数就可以实现W3C通过XHTML认证.

function vali(){
        $str=explode("/",$_SERVER['HTTP_USER_AGENT']);
        if($str[0]=='W3C_Validator'){
                $vali = <<< meta
                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
                <html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
                  <head>
                                <title>title</title>
                                <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
                                <meta http-equiv="Content-Language" content="zh-CN" />
                                <meta content="all" name="robots" />
                                <meta name="Author" content="Tr0y" />
                                <meta name="Description" content="here is description" />
                                <meta name="Keywords" content="keywords" />
                                <meta name="Copyright" content="Copyright for business don't copy" />
                  </head>
                <body>
                </body>
                </html>
meta;
                echo $vali;
                exit;
                }
}
作者:AngryFox 分类: Uncategorized July 24th, 2011 暂无评论

php curl_init函数用法

首先,在C\windows里的php.ini中我打开了extension=php_curl.dll的功能,然后也重启了apapche,以下是我写的抓取百度中PHP的信息:

<?php
   //初始化curl
   $ch = curl_init() or die (curl_error());
   echo "测试一下";
   //设置URL参数
   curl_setopt($ch,CURLOPT_URL,"http://www.baidu.com/s?wd=php");
   //要求CURL返回数据
   curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
   //执行请求
   $result = curl_exec($ch) or die (curl_error());
   //取得返回的结果,并显示
   echo $result;
   echo curl_error($ch);
   //关闭CURL
   curl_close($ch);
?>

可为什么没反应呢?连测试的文字都没有,要是我把echo “测试一下”;放到第一行就可以输出,我估计是curl_init()函数还没有运行!

你看看PHP的phpinfo()中有没有CURL扩展支持!

把php_curl.dll拷到c:\windows\和c:\windows\system32里面 重启apache
之后再试试看
不是php_curl.dll这个文件
是把php目录中的libeay32.dll,ssleay32.dll拷到c:\windows\system32里面 重启apache
如果是wamp,开启php.ini里面所有的extension=php_curl.dll

作者:AngryFox 分类: Uncategorized July 23rd, 2011 暂无评论

通过字节获得相应的容量大小

function getsize($size,$unit=0)
{
        $type = array(" KB"," MB","GB"," TB");
        if(!$size || !(int)$size)return 0;
        $result = $size/1024;
        return $result>=1024 ? getsize($result,++$unit) : sprintf("%.2f",$result).$type[$unit];
}

用发:

就会获得相应的 容量大小

作者:AngryFox 分类: Uncategorized July 23rd, 2011 暂无评论

为文件名添加诸如_thumb这样的标记
程序中经常会遇到这种情况,当你为图片生成缩略图时,往往需要保留原来的名字,而在其中插个thumb之类的字符,例如:原文件为test.jpg,生成缩略图的文件往往是test.thumb.jpg或者test_thumb.jpg这样。怎么样往里面插这样的字符呢?
  插入这样的字符有几种方法:

    $orig_filename = 'test.jpg';
    $exp_str = '_thumb';

    //first
    $file_ext = strRchr( $orig_filename, '.' );
    $fst_file = preg_replace( "/(".$file_ext.")$/", $exp_str . $file_ext , $orig_filename  );

    //second
    $orig_info = pathinfo( $orig_filename );
    $scd_file = $orig_info['filename'] . $exp_str . $orig_info['extension'];
    //第三种用substr的我就不写了。。懒啊
作者:AngryFox 分类: Uncategorized July 23rd, 2011 暂无评论

通过秒数获得具体时间

function formattime($num,$arr=array())
{
        if($num>=86400){
                //包含天
                $arr["day"] = sprintf('%d',($num/86400));
                $num -= $arr['day']*86400;
                if($num){
                        return formattime($num,$arr);
                }else{
                        return $arr;
                }
        }elseif($num>=3600){
                //小时
                $arr["hour"] = sprintf("%d",($num/3600));
                $num -= $arr['hour']*3600;
                return formattime($num,$arr);
        }elseif($num>=60){
                //分
                $arr["minute"] = sprintf("%d",($num/60));
                $arr["second"] = sprintf("%d",$num-$arr['minute']*60);
                return $arr;
        }elseif($num<60){
                $arr["second"] = $num;
                return $arr;
        }
}
//我们输入3600那么结果是1小时
//我们输入3601那么是1小时1秒
//我们输入60那么显示1分钟
//等等。有兴趣的朋友可以把这玩意扩展到月甚至年之类的
//用法,返回一个数组
print_R(formattime('3601'));
作者:AngryFox 分类: Uncategorized July 23rd, 2011 暂无评论

拖动div效果函数
说明:
两个参数
第一个事元素id或者元素本身
第二个是可选参数,0或1,表示层是否随滚动条的滚动一起运动

function drag(o,s)
{
      if (typeof o == "string") o = document.getElementById(o);
      o.orig_x = parseInt(o.style.left) - document.body.scrollLeft;
      o.orig_y = parseInt(o.style.top) - document.body.scrollTop;
      o.orig_index = o.style.zIndex;
      //author: www.longbill.cn
      o.onmousedown = function(a)
      {
            this.style.cursor = "move";
            this.style.zIndex = 10000;
            var d=document;
            if(!a)a=window.event;
            var x = a.clientX+d.body.scrollLeft-o.offsetLeft;
            var y = a.clientY+d.body.scrollTop-o.offsetTop;
            
            d.ondragstart = "return false;"
            d.onselectstart = "return false;"
            d.onselect = "document.selection.empty();"
                        
            if(o.setCapture)
                  o.setCapture();
            else if(window.captureEvents)
                  window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP); 

            d.onmousemove = function(a)
            {
                  if(!a)a=window.event;
                  o.style.left = a.clientX+document.body.scrollLeft-x;
                  o.style.top = a.clientY+document.body.scrollTop-y;
                  o.orig_x = parseInt(o.style.left) - document.body.scrollLeft;
                  o.orig_y = parseInt(o.style.top) - document.body.scrollTop;
            } 

            d.onmouseup = function()
            {
                  if(o.releaseCapture)
                        o.releaseCapture();
                  else if(window.captureEvents)
                        window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
                  d.onmousemove = null;
                  d.onmouseup = null;
                  d.ondragstart = null;
                  d.onselectstart = null;
                  d.onselect = null;
                  o.style.cursor = "normal";
                  o.style.zIndex = o.orig_index;
            }
      }
      
      if (s)
      {
            var orig_scroll = window.onscroll?window.onscroll:function (){};
            window.onscroll = function ()
            {
                  orig_scroll();
                  o.style.left = o.orig_x + document.body.scrollLeft;
                  o.style.top = o.orig_y + document.body.scrollTop;
            }
      }
}