Forum Moderators: coopster
I understand that this wouldnt be a 'real' ping or traceroute but anything will do for me.
I used to have a script that utilized the system() command but the webhost disabled it.
Then I had a script which did something like this:
function p($target){
message("<p><b>Ping Results:</b><blockquote>"); if (! $msg .= trim(nl2br(`ping -c5 '$target'`))) #bugfix
$msg .= "Ping failed. Host may not be active."; $msg .= "</blockquote></p>"; message($msg); }
function tr($target){
message("<p><b>Traceroute Results:</b><blockquote>"); if (! $msg .= trim(nl2br(`/usr/sbin/traceroute '$target'`))) #bugfix
$msg .= "Traceroute failed. Host may not be active."; $msg .= "</blockquote></p>"; message($msg); }
That script doesnt seem to use the system() function but has also stopped working recently so I was looking for something that would not depend on the Ping and Traceroute utilities on the server but rather 'mimic' those functions and provide comparable output.
Thanks
so for icmp you need sockets and start the communication then by yourself. this can be done with php: [php.net...]
hf