NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Internal Server Error

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 10-11-2006, 12:56 PM THREAD STARTER               #1 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




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 Code:
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($sock1024);
              }

            foreach(
$avaliable_phrases as $phrase){
                if(
eregi($phrase,$whois)){
????: NamePros.com http://www.namepros.com/programming/246271-internal-server-error.html
                    
$avaliable true;
????: NamePros.com http://www.namepros.com/showthread.php?t=246271
                }
            }
        
            @
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 by Mikor; 10-11-2006 at 01:49 PM.
Barrucadu is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 10:57 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger