使用批量主题类
我想利用大量的域名创建,Expire和Registrar这里的错误在哪里?我是新的php程序员
<?php
error_reporting(E_ERROR | E_WARNING);
# Change to path of phpwhois folder, wherever it is
define ("PHP_WHOIS_PATH" , "phpwhois-4.2.2");
include(PHP_WHOIS_PATH . '/whois.main.php');
function ez( $domain )
{
$whois = new Whois();
$data = $whois->Lookup($domain);
$return['registrar'] = $data['regyinfo']['registrar'];
$return['expires'] = $data['regrinfo']['domain']['expires'];
$return['created'] = $data['regrinfo']['domain']['created'];
return $return;
}
$domain = $_POST['url'];
if(substr(strtolower($domain), 0, 7) == "http://") $domain = substr($domain, 7); // remove http:// if included
if(substr(strtolower($domain), 0, 8) == "https://") $domain = substr($domain, 8); // remove https:// if included
if(substr(strtolower($domain), 0, 4) == "www.") $domain = substr($domain, 4);//remove www from domain
$domain = rtrim($domain,"/");
$text = ez($domain) ;
$domainlist = explode ("\n", trim ($text));
// Just the expires :
foreach ($domainlist as $line) {
$line = ez(trim($line));
echo "Your Domain: " . $_POST['url'];
echo "<br />\n";
echo "Expire Date: ". $text['expires'];
echo "<br />\n";
echo "Registrar: " . $text['registrar'];
echo "<br />\n";
echo "Creation Date: " . $text['created'];
echo "<br />\n";
}
?>