helraizer Posted December 21, 2007 Share Posted December 21, 2007 Hi folks, how would one ping a website with php, I was thinking about using shell_exec; would that be the best approach or is there another way? Sam Quote Link to comment https://forums.phpfreaks.com/topic/82692-ping-with-php/ Share on other sites More sharing options...
chigley Posted December 21, 2007 Share Posted December 21, 2007 Do you just want to see if a server is online? Or do you physically want the ping response? Quote Link to comment https://forums.phpfreaks.com/topic/82692-ping-with-php/#findComment-420584 Share on other sites More sharing options...
helraizer Posted December 21, 2007 Author Share Posted December 21, 2007 Do you just want to see if a server is online? Or do you physically want the ping response? The former, preferably. I've got something, made a code, for the latter. Sam Quote Link to comment https://forums.phpfreaks.com/topic/82692-ping-with-php/#findComment-420596 Share on other sites More sharing options...
mbeals Posted December 21, 2007 Share Posted December 21, 2007 you could do it the easy way with a call to the system() function.... system("(ping $ip) > /dev/null &"); or you could actually create the socket connection and the ping packet in php: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=8&txtCodeId=1786 Quote Link to comment https://forums.phpfreaks.com/topic/82692-ping-with-php/#findComment-420615 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.