stilllearning Posted June 8, 2010 Share Posted June 8, 2010 Hi Everyone I have a few hosts on a WAN for which I have set up a website in order to connect to these hosts via http. Connecting to the hosts work fine. However I would like to add 2 extra buttons to be able to ping and traceroute to these units. So far I have figured out I need to install PEAR, which I have done. But writing the scripts for both ping and traceroute I have no idea how to do that. I have had a google, but most of the scripts out there don't do what I want to do. Can someone please help me with this? TIA Quote Link to comment https://forums.phpfreaks.com/topic/204149-ping-traceroute-from-php-script/ Share on other sites More sharing options...
dabaR Posted June 8, 2010 Share Posted June 8, 2010 Hi there. You would like to have a button on a webpage, which makes the web server ping the machine from which the button is being pressed? Quote Link to comment https://forums.phpfreaks.com/topic/204149-ping-traceroute-from-php-script/#findComment-1069242 Share on other sites More sharing options...
Andy-H Posted June 8, 2010 Share Posted June 8, 2010 <?php $out = `ping google.com`; $trace = `tracert google.com`; echo '<pre>' . $out . "\r\n\r\n" . $trace . '</pre>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/204149-ping-traceroute-from-php-script/#findComment-1069255 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.