Developer Center

ModifyWhois() - Update Whois

It is used to update the whois information of the domain, if not supported, an error message appears.

public function ModifyWhois($params=[],$whois=[]){
    $domain     = idn_to_ascii($params["domain"],0,INTL_IDNA_VARIANT_UTS46);

    $convert_key = [
        'registrant'        => 'Owner',
        'administrative'    => 'Admin',
        'technical'         => 'Tech',
        'billing'           => 'Bill',
    ];
    $contact_types          = array_keys($convert_key);

    foreach($contact_types AS $w_ct)
    {
        $ct = $convert_key[$w_ct];
        
        $whois_data = [
            'name'              => $whois[$w_ct]["FirstName"] ?? '',
            'surname'           => $whois[$w_ct]["LastName"] ?? '',
            'fullname'          => $whois[$w_ct]["Name"] ?? '',
            'company'           => $whois[$w_ct]["Company"] ?? '',
            'emailaddr'         => $whois[$w_ct]["EMail"] ?? '',
            'address1'          => $whois[$w_ct]["AddressLine1"] ?? '',
            'address2'          => $whois[$w_ct]["AddressLine2"] ?? '',
            'city'              => $whois[$w_ct]["City"] ?? '',
            'state'             => $whois[$w_ct]["State"] ?? '',
            'zip'               => $whois[$w_ct]["ZipCode"] ?? '',
            'country'           => $whois[$w_ct]["Country"] ?? '',
            'telnocc'           => $whois[$w_ct]["PhoneCountryCode"] ?? '',
            'telno'             => $whois[$w_ct]["Phone"] ?? '',
            'faxnocc'           => $whois[$w_ct]["FaxCountryCode"] ?? '',
            'faxno'             => $whois[$w_ct]["Fax"] ?? '',
        ];
        
        

        $modify = $this->api->modify_contact($domain,$ct,$whois_data);
        if(!$modify){
            $this->error = $this->api->error;
            return false;
        }
        
    }
    
    return true;
}

Parameters;

  • $params Provides the value of [options] index in the $order variable in the class.
  • $whois Whois information, example:
    Array
    (
        [registrant] => Array
        (
            [Name] => John Doe
            [FirstName] => John
            [LastName] => Doe
            [Company] => WISECP
            [AddressLine1] => sample sample test sample test
            [AddressLine2] => test test
            [ZipCode] => 0000
            [State] => NY
            [City] => New York
            [Country] => US
            [PhoneCountryCode] => 1
            [Phone] => 2025550103
            [FaxCountryCode] => 1
            [Fax] => 2025550103
            [EMail] => [email protected]
        )
    
        [administrative] => Array
        (
            [Name] => John Doe
            [FirstName] => John
            [LastName] => Doe
            [Company] => WISECP
            [AddressLine1] => sample sample test sample test
            [AddressLine2] => test test
            [ZipCode] => 0000
            [State] => NY
            [City] => New York
            [Country] => US
            [PhoneCountryCode] => 1
            [Phone] => 2025550103
            [FaxCountryCode] => 1
            [Fax] => 2025550103
            [EMail] => [email protected]
        )
        [technical] => Array
        (
            [Name] => John Doe
            [FirstName] => John
            [LastName] => Doe
            [Company] => WISECP
            [AddressLine1] => sample sample test sample test
            [AddressLine2] => test test
            [ZipCode] => 0000
            [State] => NY
            [City] => New York
            [Country] => US
            [PhoneCountryCode] => 1
            [Phone] => 2025550103
            [FaxCountryCode] => 1
            [Fax] => 2025550103
            [EMail] => [email protected]
        )
        [billing] => Array
        (
            [Name] => John Doe
            [FirstName] => John
            [LastName] => Doe
            [Company] => WISECP
            [AddressLine1] => sample sample test sample test
            [AddressLine2] => test test
            [ZipCode] => 0000
            [State] => NY
            [City] => New York
            [Country] => US
            [PhoneCountryCode] => 1
            [Phone] => 2025550103
            [FaxCountryCode] => 1
            [Fax] => 2025550103
            [EMail] => [email protected]
        )
    )
    

Retrieval Value;

Boolean (true or false) should be displayed.

DeleteCNS() - Delete Child Nameserver getWhoisPrivacy() - Whois Protection Status

Do you have any questions?

Feel free to contact us
Contact Us
Copyright © 2024. All Rights Reserved.
Join Our Discord Channel
Top