View previous topic :: View next topic |
Author |
Message |
Mikor -
Joined: 21 Aug 2006 Posts: 144 Location: Hull, England
|
Posted: Wed Oct 11, 2006 6:50 pm Post subject: Internal Server Error |
|
|
Something in this code causes an internal server error, I cant find it...
Code: | function whois ($server, $query, $port, $avaliable_phrases){
$query = whois_prepare($query, $server);
$avaliable = false;
$sock = @fsockopen($server,$port);
if(!$sock){
$output = '<tr><td>'.$query.'</td><td style=\'color:#FF0000\' colspan=\'2\'>Could not open socket.</td></tr>';
return $output;
}else{
$send_request = @fputs($sock,$query.'\r\n');
if(!$send_request){
$output = '<tr><td>'.$query.'</td><td style=\'color:#FF0000\' colspan=\'2\'>Unable to send request.</td></tr>';
return $output;
}else{
while(!feof($sock)) {
$whois = @fgets($sock,128);
}
foreach($avaliable_phrases as $phrase){
if(eregi($phrase,$whois)){
$avaliable = true;
}
}
@fclose($sock);
if($avaliable == true){
$output = '<tr><td>'.$query.'</td><td style=\'color:#00FF00\'>Avaliable</td><td style=\'text-align:center;\'>n/a</td></tr>';
}else{
$output = '<tr><td>'.$query.'</td><td style=\'color:#FF0000\'>Unavaliable</td><td><a href=\'domainwhois.php?domain='.$query.'\'>Whois</a></td></tr>';
}
return $output;
}
}
} |
_________________ Yarrt.com - Free Arcade
RypNet.co.uk - Online Game
MSN: michael_walker_2004 <at> hotmail <dot> com |
|
Back to top |
|
|
Mikor -
Joined: 21 Aug 2006 Posts: 144 Location: Hull, England
|
Posted: Wed Oct 11, 2006 7:34 pm Post subject: |
|
|
well, i've found out that its caused by the fgets - any ideas? _________________ Yarrt.com - Free Arcade
RypNet.co.uk - Online Game
MSN: michael_walker_2004 <at> hotmail <dot> com |
|
Back to top |
|
|
Mikor -
Joined: 21 Aug 2006 Posts: 144 Location: Hull, England
|
Posted: Wed Oct 11, 2006 8:49 pm Post subject: |
|
|
Fixed, it appears that I had an outdated list of whois servers... _________________ Yarrt.com - Free Arcade
RypNet.co.uk - Online Game
MSN: michael_walker_2004 <at> hotmail <dot> com |
|
Back to top |
|
|
|