Jump to content

PHP Ping Test


jgphp

Recommended Posts

Hello All happy new year

 

I am trying to make a php page that detects if something is plugged in to the ethernet port.

This would be complex if not impossible. I however managed to do something similar the device

that will be plugged in has a static address 192.168.1.1. so I created a ping that says if the device is up or

down.

 

function ping($host, $port, $timeout)

{

  $fP = fSockOpen($host, $port, $errno, $errstr, $timeout);

  $status;

 

  if ($fP)

  { echo "Device is ready to accept data";}

  else

  { echo "Device Down - Retrying connection"; }

 

What I would like to do is have a script that is constantly checking is the device is plugged or when it is not

(so sort of a loop or auto detect). The idea is to have an image with the device up or down.

 

Regards

and a happy new year

JG

Link to comment
https://forums.phpfreaks.com/topic/254448-php-ping-test/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.