Hello Everybody
Can anybody suggest me how to write code for Ping and traceroute so that i can directly connect to the server on that port
Welll i can connect to server using fsockopen on port 79(for Finger) but what are the command that i ahve to send to get the desired information
About traceroute dont have any idea!!

Thanks in advance

                Vinay

    the best thing to do is run the prog from your script. simplest way:

    $result = ping $host;
    $result = traceroute $host;

    that's extremely insecure so dont use it. check the php manual for a better way.

    -paul
    http://xhawk.net

      I think you are mixing things up here. 'Connecting to a port' is used with the tcp protocol. It means establishing a connection through a socket. 'ping' and 'traceroute' both use icmp and not tcp. Ping just sends a icmp type 8 packet (echo request) and waits for the other machine to reply. Traceroute works by sending an icmp packet with a ttl of 1, and stores the reply. Then it sends an icmp with a ttl (which is 'time to live' by the way) of 2 and stores the last host in the chain. Then is repeated until the destination host is the same as the host you are tracerouting. This is a very short and probably un-understandable explanation :-) if you don't know about tcp/ip and icmp, so I suggest you read some whitepapers on these protocols and/or examine some source for ping and traceroute. Anyway, the finger protocol is obsolete and no serious admin will leave it working in his/her server. Why do you want to ping your host anyway? If the fsockopen() succeeds, the host is reachable, otherwise the errorcode will be set to 'host unreachable'.

        Thank you for clarifying that ping and traceroute does not use tcp. I want shouting at TCP. How do send "echo request" via my script. I want to make a script where i will just type the hostname and inreply will get the traceroute result. Please dso tell me how to do this.

        Thanking once again
        Vinay

          i already answered this question. (???)

            Yes, the easiest way is like paul said...

              8 days later

              Hello,
              Thanks for the reply, but as i dont have the access to run traceroute on a server where i have got Telnet access, so what should i do. I want to execute that command from web-brwoser. I cannot reply upon the exec function. So please suggest any other method for traceroute and Ping.

              Thanks again

                Write a Reply...