Thread: PING by PHP?

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    8
    Rep Power
    0
    I'm using Windows NT (yeah, I know.. :^) and I want to be able to check if another NT PC (not a server) is up before I exec a command to it. Any ideas? I already tried doing:

    <CODE>
    if (!($ip = fsockopen(gethostbyname("this-pc"), 7, &$errno, &$errstr, 2 ))) {
    echo "Can't get throughn";
    } else {
    echo "Socket opened!n";
    fclose($ip);
    }
    </CODE>

    To try and open a socket to the ECHO service (i.e., the ping port?) but that always fails.
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    Try the true statement first and leave out the false statement and see if it works.
    What I mean is to assume the socket always opened.

Similar Threads

  1. Replies: 2
    Last Post: August 18th, 2004, 10:45 PM
  2. Replies: 4
    Last Post: January 28th, 2004, 08:29 AM
  3. PHP with UnixODBC
    By coder4hire in forum PHP Development
    Replies: 2
    Last Post: January 20th, 2004, 01:14 PM
  4. Passing string from PHP to Javascript
    By ka8oad in forum JavaScript Development
    Replies: 4
    Last Post: January 17th, 2004, 03:12 PM
  5. UnixODBC + PHP + Apache + Empress
    By coder4hire in forum Database Management
    Replies: 0
    Last Post: January 15th, 2004, 01:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo