快速业务通道

分享几个非常有用的PHP代码片段

作者 佚名技术 来源 NET编程 浏览 发布时间 2012-05-22
ikipedia.org/wiki/Whois

  //

  $servers = array(

  "biz" => "whois.neulevel.biz",

  "com" => "whois.internic.net",

  "us" => "whois.nic.us",

  "coop" => "whois.nic.coop",

  "info" => "whois.nic.info",

  "name" => "whois.nic.name",

  "net" => "whois.internic.net",

  "gov" => "whois.nic.gov",

  "edu" => "whois.internic.net",

  "mil" => "rs.internic.net",

  "int" => "whois.iana.org",

  "ac" => "whois.nic.ac",

  "ae" => "whois.uaenic.ae",

  "at" => "whois.ripe.net",

  "au" => "whois.aunic.net",

  "be" => "whois.dns.be",

  "bg" => "whois.ripe.net",

  "br" => "whois.registro.br",

  "bz" => "whois.belizenic.bz",

  "ca" => "whois.cira.ca",

  "cc" => "whois.nic.cc",

  "ch" => "whois.nic.ch",

  "cl" => "whois.nic.cl",

  "cn" => "whois.cnnic.net.cn",

  "cz" => "whois.nic.cz",

  "de" => "whois.nic.de",

  "fr" => "whois.nic.fr",

  "hu" => "whois.nic.hu",

  "ie" => "whois.domainregistry.ie",

  "il" => "whois.isoc.org.il",

  "in" => "whois.ncst.ernet.in",

  "ir" => "whois.nic.ir",

  "mc" => "whois.ripe.net",

  "to" => "whois.tonic.to",

  "tv" => "whois.tv",

  "ru" => "whois.ripn.net",

  "org" => "whois.pir.org",

  "aero" => "whois.information.aero",

  "nl" => "whois.domain-registry.nl"

  );

  if (!isset($servers[$ext])){

  die('Error: No matching nic server found!');

  }

  $nic_server = $servers[$ext];

  $output = '';

  // connect to whois server:

  if ($conn = fsockopen ($nic_server, 43)) {

  fputs($conn, $domain."\r\n");

  while(!feof($conn)) {

  $output .= fgets($conn,128);

  }

  fclose($conn);

  }

  else { die('Error: Could not connect to ' . $nic_server . '!'); }

  return $output;

  }

 

  10. 通过Email发送PHP错误

  // Our custom error handler

  function nettuts_error_handler($number, $message, $file, $line, $vars){

  $email = "

  

An error ($number) occurred on line

  

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号