I’m using the following to get status of and IP or a domain
<?php
system('ping -c1 -w1 193.33.186.70') ;
?>
How would I ping port 80 tho? Returns nothing at all once port is supplied.. tried to add it to the end by ‘:80’ and ‘ 80’
Any ideas appreaciated!
If what you want to do is find out whether a given host will accept TCP connections on port 80, you can do this:
For anything other than TCP it will be more difficult (although since you specify 80, I guess you are looking for an active HTTP server, so TCP is what you want). TCP is sequenced and acknowledged, so you will implicitly receive a returned packet when a connection is successfully made. Most other transport protocols (commonly UDP, but others as well) do not behave in this manner, and datagrams will not be acknowledged unless the overlayed Application Layer protocol implements it.
To fresh up your knowledge on Transport Layer protocols. You should read up on ICMP and TCP, as well as the OSI Model.