SimplePortal
Support => International Support => Polish => Topic started by: cieplutki on January 03, 2016, 01:47:08 PM
-
Witam,
potrzebuję zwielokrotnić ten kod php tak by pokazywał kilka lub kilkanaście "hubów"
<?php
// A PHP comment.
// A function:
function hub()
{
$hub[] = "imperium1.pl:1234" ;
for( $a = 0 ; $a < count( $hub ) ; $a++ )
{
$ent = explode( ":", $hub[$a] ) ;
$adres = $ent[0] ;
$port = $ent[1] ;
$fp = @fsockopen($adres, $port, $errno, $errstr, 5);
if ($fp) {
echo '<img src="http://dcmaniak.com.pl/images/hubon.gif" alt="On-Line" title="HUB ON-Line " border="0" /><br />';
} else {
echo '<img src="http://dcmaniak.com.pl/images/huboff.gif" alt="Off-Line" title="HUB OFF-Line " border="0" /><br />';
}
}
// Some HTML
echo 'Hub: <b>Imperium</b>';
}
return hub();
?>
Ten działa na pojedynczy hub jak dodać w php kolejne
-
http://simpleportal.net/index.php?topic=14227.0