Internal Server Error

SpaceshipSpaceship
SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by Spaceship
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
Close
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
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back