I have a whois look-up script that has a function that always fails. I have been working on it for 4 hours now with no success, always get the same error message "Syntax error - unexpected T_LNumber
Does anyone know what the problem might be?
Here's the entire function: (I commented where the error is)
function bewhois($dom,$domt,&$regdet)
{
if ($regdet=='*')
{
$regdet='';
$connection=@fsockopen('whois.dns.be',4343,$errorno,$errordesc);
if ($connection)
{
fputs($connection,'GET 1.0 $dom');
while(!feof($connection))
{
$regdet[]=fgets($connection,255);
}
fclose($connection);
if (count($regdet)2) //THIS IS THE ERROR LINE RIGHT HERE
return(5);
$registered=1;
for($index=0;$index<count($regdet);$index++)
{
$lne=strtolower($regdet[$index]);
$pos=strpos($lne,"status: free");
if (is_integer($pos))
{
$registered=0;
break;
}
}
return($registered);
}
else
return(5);
}
else
{
$regdet="";
$connection=@fsockopen("whois.dns.be",43,$errorno,$errordesc);
if ($connection)
{
fputs($connection,$dom.$domt."\r\n");
while(!feof($connection))
{
$regdet[]=fgets($connection,255);
}
fclose($connection);
if (count($regdet)2)
return(5);
$registered=1;
for($index=0;$index<count($regdet);$index++)
{
$lne=strtolower($regdet[$index]);
$pos=strpos($lne,"free");
if (is_integer($pos))
{
$registered=0;
break;
}
}
return($registered);
}
else
return(5);
}
}