I have an error in my code when I compile :

> 
> Fatal error: Uncaught ArgumentCountError: Too few arguments to
>  function getData::QueryWhoisServer(), 0 passed in
>  C:\xampp\htdocs\testVisitor\index.php on line 19 and exactly 2
>  expected in C:\xampp\htdocs\testVisitor\Model\getData.php:72 Stack
>  trace: #0 C:\xampp\htdocs\testVisitor\index.php(19):
>  getData->QueryWhoisServer() #1 {main} thrown in
>  C:\xampp\htdocs\testVisitor\Model\getData.php on line 72
> 
> 
> 

I know that since php 7.0 I need to pass argument but the argument are not recognize...

here is my code:

index.php :

```
require_Once('Model/getData.php');
require_Once('Controller/writeData.php');

$getData = new getData();
$writeData =new  writeData();

$getData->get_ip();
$getData->LookupIP($domain);
$getData->ValidateIP($domain);
$getData->QueryWhoisServer();

if($domain && $pageEnCours != preg_match("#localhost/testVisitor/$#",$pageEnCours)) {
    $domain = trim($domain);

    if($getData->ValidateIP($domain)) {
        $result = $getData->LookupIP($domain);
       $writeData->write_domain($result);
    }

    else{
        write_error();
    };

}
echo $domain;
echo "cc";

```

and getData.php :

```
$urlPart1 = $_SERVER['HTTP_HOST'] ;
$urlPart2 =  $_SERVER['REQUEST_URI'];
$pageEnCours = $urlPart1 .= $urlPart2;
$domain ='0.0.0.0';
class getData
{

// For the full list of TLDs/Whois servers see http://www.iana.org/domains/root/db/ and http://www.whois365.com/en/listtld/
    /**
     * Récupérer la véritable adresse IP d'un visiteur
     */
    function get_ip() {
        // IP si internet partagé
        global $domain;
        if (isset($_SERVER['HTTP_CLIENT_IP'])) {
            return $domain =$_SERVER['HTTP_CLIENT_IP'];
        }
        // IP derrière un proxy
        elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            return $domain=$_SERVER['HTTP_X_FORWARDED_FOR'];
        }
        // Sinon : IP normale
        else {
            return $domain=(isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '');
        }
    }

    function LookupIP($ip) {
        $whoisservers = array(
            //"whois.afrinic.net", // Africa - returns timeout error :-(
            //"whois.lacnic.net", // Latin America and Caribbean - returns data for ALL locations worldwide :-)
            //"whois.apnic.net", // Asia/Pacific only
            //"whois.arin.net", // North America only
            //"whois.ripe.net" // Europe, Middle East and Central Asia only
        );
        $results = array();
        foreach($whoisservers as $whoisserver) {
            $result = QueryWhoisServer($whoisserver, $ip);

            if ($result && !in_array($result, $results)) {
                $results[$whoisserver] = $result;
            }

        }
        $res = "RESULTS FOUND: " . count($results);
        foreach($results as $whoisserver=>$result) {
            $res .= "\n\n-------------\nLookup results for " . $ip . " from " . $whoisserver . " server:\n\n" . $result;
        }
        return $res;
    }
    function ValidateIP($ip) {
        $ipnums = explode(".", $ip);
        if(count($ipnums) != 4) {
            return false;
        }
        foreach($ipnums as $ipnum) {
            if(!is_numeric($ipnum) || ($ipnum > 255)) {
                return false;
            }
        }
        return $ip;
    }

    function QueryWhoisServer($whoisserver , $domain ) {
        $port = 43;
        $timeout = 10;
        $fp = @fsockopen($whoisserver, $port, $errno, $errstr, $timeout) or die("Socket Error " . $errno . " - " . $errstr);
        //if($whoisserver == "whois.verisign-grs.com") $domain = "=".$domain; // whois.verisign-grs.com requires the equals sign ("=") or it returns any result containing the searched string.
        fputs($fp, $domain . "\r\n");
        $out = "";
        while(!feof($fp)){
            $out .= fgets($fp);
        }
        fclose($fp);
        $res = "";
        if((strpos(strtolower($out), "error") === FALSE) && (strpos(strtolower($out), "not allocated") === FALSE)) {
            $rows = explode("\n", $out);
            foreach($rows as $row) {
                $row = trim($row);
                if(($row != '') && ($row{0} != '#') && ($row{0} != '%') && ($row != preg_match("#^netname|^descr|^country|^person|^address|^phone#",$row ))) {
                    $res .= $row."\n";
                }
            }
        }
        return $res;
    }

}

```