SHARE
TWEET

Untitled

a guest Jul 23rd, 2013 257 Never
  1. if ($station1) {
  2.     echo "<a href='http://192.168.1.1:5800'>Station 1 active.</a>";
  3.     echo "<br />";
  4.         fclose($station1);
  5.     } else {
  6.         echo "Station 1 is inactive.";
  7.     echo "<br />";
  8.     }
  9.        
  10. Port 5801 -> 192.168.1.1
  11.  Port 5802 -> 192.168.1.2
  12.  Port 5803 -> 192.168.1.3
  13.  etc.
  14.        
  15. <a href="123.123.123.123:5801">Station 1 active.</a>
  16. <a href="123.123.123.123:5802">Station 2 active.</a>
  17. <a href="123.123.123.123:5803">Station 3 active.</a>
  18.        
  19. <?php
  20. if(substr($_SERVER['SERVER_ADDR'], -3)=="1.1"){$server=$_SERVER['SERVER_ADDR'];}else{$server='123.123.YOUR.WAN123.123'}
  21.     $fp = fsockopen($server, 5800, $errno, $errstr);
  22.     if (!$fp) {
  23.         echo "ERROR: $errno - $errstr<br />n";
  24.     } else {
  25.         echo "<a href='http://'.$server.':5800'>Station 1 active.</a>";
  26.         fclose($fp);
  27.     }
  28.     ?>
RAW Paste Data
Top