PHP Scripts Development » PHP Classes Support Forum

[sticky]

Domain search results always display "registered"

(8 posts)

Great offers not only for geeks!


  1. User has not uploaded an avatar

    jsmith
    Member

    I have uploaded the script onto a linux hosting server and no matter which domain name is entered, then results always display the "this domain is registered" message.

    I have tested this script on my local testing server using apache on a windows OS and it works perfectly.

    In addition, I have changed the VAR to "linux" before uploading to the linux server.

    Of all domain search scripts, this is the one that fits my situation the best, so any guidance on getting it to function correctly on this linux server is greatly appreciated.

    view the sample page unaltered at:
    http://www.jrs-webdesign.com/classes/whois/whois_example.php
    search for a domain which you know is not registered and you will see that it always returns the same message.

    Thank you,
    Jason

    Posted 4 months ago #
  2. Hi,

    use the "win" mode, this mode is using the fsockopen function and not the "linux whois" function, which is not accessible to you.

    Maybe the name should be another, since I got that question before :D

    Posted 4 months ago #
  3. User has not uploaded an avatar

    jsmith
    Member

    Thanks for the speedy reply.

    Unfortunately, changing the mode to "win" results in the domain search request to "hang" and eventually time-out. Whats worse is that after it times out, the page goes blank.

    Any suggestions?

    I find it interesting that I have success on my localhost windows platform, but not when I upload to the linux hosting environment.

    Thanks again,
    Jason

    Posted 4 months ago #
  4. Please try this code and post the result here:

    function get_whois_data($test_server, $test_domain) {
    	$msg = "";
    	$connection = fsockopen($test_server, 43, $errno, $errstr, 10);
    	if (!$connection) {
    		$msg = "Can't connect to the server!";
    	} else {
    		sleep(2);
    		fputs($connection, $test_domain."\r\n");
    		while (!feof($connection)) {
    			$msg[] = fgets($connection, 4096);
    		}
    		fclose($connection);
    	}
    	return $msg;
    }
    print_r(get_whois_data("whois.crsnic.net", "finalwebsites.com"));
    Posted 4 months ago #
  5. User has not uploaded an avatar

    jsmith
    Member

    I uploaded a php page with the afore mentioned code wrapped in php tags at the following location:

    http://www.jrs-webdesign.com/codetest.php

    which generated the following results:

    Warning: fsockopen() [function.fsockopen]: unable to connect to whois.crsnic.net:43 (Connection timed out) in /home/content/j/s/v/jsvb1977/html/codetest.php on line 4
    Can't connect to the server!

    Posted 4 months ago #
  6. Works fine on my own server, maybe some limitation on your web host?

    Ask their support department before you spend more time on that issue (show them this thread or the snippet I posted)

    Posted 4 months ago #
  7. User has not uploaded an avatar

    jsmith
    Member

    I was told by my web host (godaddy) that the servers will not allow access OUT of their server on port 43.

    In the snippet you provided to me earlier in the thread:

    whois.crsnic.net:43

    Godaddy says I may use port 80, or port 443. I have purchased an SSL certificate to be used with certain portions of my site; in fact, the final destination of the whois script will be located on a page which will be encrypted with SSL on port 443.

    May i adjust the code in the script to allow access from their server over port 80 OR port 443?

    Let me know if this is possible.

    Thank you,
    Jason

    Posted 4 months ago #
  8. Jason,
    this depends on the whois server, If he will answer on some other you're fine.

    Anyway Godaddy is a very bad web hosting provider, their accounts are very limited.

    Posted 4 months ago #

RSS feed for this topic

Reply

You must log in to post.