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 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? 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 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 Link to comment https://forums.phpfreaks.com/topic/82692-ping-with-php/#findComment-420615 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.