NameSilo

Internal Server Error

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

Barrucadu

Established Member
Impact
64
FIXED: Internal Server Error

FIXED


When I run a whois script I made, I get an internal server error when it calls fgets(), here is the code:

PHP:
function whois ($server, $query, $port, $avaliable_phrases){
	$query = whois_prepare($query, $server);
	$avaliable = false;
	$sock = @fsockopen($server,$port);
	$whois = '';
	
	echo '<tr><td>'.$query.'</td>';
	
	if(!$sock){
		die('<td style=\'color:#FF0000\' colspan=\'2\'>Could not open socket.</td></tr>');
	}else{
		$send_request = @fputs($sock,$query.'\r\n');

		if(!$send_request){
			die('<td style=\'color:#FF0000\' colspan=\'2\'>Unable to send request.</td></tr>');
		}else{
			while (!feof($sock)) {
       			$whois .= fgets($sock, 1024);
  			}

			foreach($avaliable_phrases as $phrase){
				if(eregi($phrase,$whois)){
					$avaliable = true;
				}
			}
		
			@fclose($sock);
			
			if($avaliable == true){
				echo '<td style=\'color:#00FF00\'>Avaliable</td><td style=\'text-align:center;\'>n/a</td></tr>';
			}else{
				echo '<td style=\'color:#FF0000\'>Unavaliable</td><td><a href=\'domainwhois.php?domain='.$query.'\'>Whois</a></td></tr>';
			}
		}
	}
}

Fixed, it appears that I had an outdated list of whois servers...
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back