Hallo,
ich rufe das whois von "phpwhois-4.2.2 sourceforge" folgendermaßen auf:
<?php
function mywhois ($IP)
{
include('whois.main.php');
$rc = '';
$whois = new Whois();
$result = $whois->Lookup($IP,false);
$rawdata = $result['rawdata'];
foreach ($rawdata as $wert)
{
$rc .= "$wert\n";
}
return $rc;
}
?>
Beim ersten Aufruf von mywhois werden die Daten korrekt geliefert, beim zweiten Aufruf jedoch kommt die Meldung:
Fatal error: Cannot redeclare class Whois in /home/..../htdocs//whois/whois.main.php on line 325
Da ich noch völlig unbedarft bin in objektor. Progr. möchte ich das whois.main.php möglichst als "black box" betrachten. Kann ich den Fehler durch eine Änderung im obigen Programm beheben?