0

using bulk whois class

I want to make use of bulk of domain creation, Expire and Registrar where is my mistake here? I am new php programmer

<?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";

}
?>
reixa
  • 6,903
  • 6
  • 49
  • 68
  • 1
    Elaborate your problem please. It will help people to understand your code and what your're expecting it to do. – reixa Jul 24 '14 at 07:21
  • just i want to do check expire date, create date registrar in bulk – computer_prince Jul 24 '14 at 07:28
  • And what does not work exactly? BTW, note that you have once `regyinfo` and twice `regrinfo` for the key. BTW2 your string munging will be wrong sometimes, your code would not allow to query for domain name `www.com` for example. Your code should also deal with errors, if `$data` in `ez()` is not provisioned correctly. – Patrick Mevzek Jan 02 '18 at 22:59

0 Answers0