stephenmelody Posted July 24, 2006 Share Posted July 24, 2006 Hello All!I am trying to develop an application that will ping a IP address or computer name from the database to return an online or offline image on the webpage depending on the ping results. ie if the ping returns the packet the page displays online, and if it doenst it displays offline.If anyone has any idea on how to do this then I would be extremely grateful.Cheers,Steve. Quote Link to comment Share on other sites More sharing options...
zq29 Posted July 24, 2006 Share Posted July 24, 2006 You can use system commands to do this on either Windows or *NIX with something like this:[code]<?phpexec("ping 192.168.1.1",$out);echo "<pre>"; print_r($out); echo "</pre>";?>[/code] Quote Link to comment Share on other sites More sharing options...
stephenmelody Posted July 24, 2006 Author Share Posted July 24, 2006 I copied and pasted the code into a lovely new php page. and it went all wrong and gave me this:Warning: exec(): Unable to fork [ping 127.0.0.1] in C:\Inetpub\apps site\pinger\ping3.php on line 2any clues?Ta,Steve Quote Link to comment Share on other sites More sharing options...
trq Posted July 24, 2006 Share Posted July 24, 2006 Is php running in safe mode? Quote Link to comment Share on other sites More sharing options...
ChaosXero Posted July 24, 2006 Share Posted July 24, 2006 If it's a MySQL Server/Database you can use mysql_ping (or similar for other DB flavors).http://us2.php.net/manual/en/function.mysql-ping.php Quote Link to comment 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.