Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: online/offline list'as

Parašė Lordcraft· 2007 Lap. 29 02:11:05
#1

Daleiskim turiu koda kuri rasau php-fusion i pridetini psl ir rodo serverio statusa:

<?php
$host = 'google.lt';
$port = '80';

function onlineIndicator($host ,$port){
$online=false;

$fp = @fsockopen($host, $port, $errno, $errstr, 1);
if($fp) {
$online=true;
}

if ($online){
return 'online';
} else {
return 'offline';
}
}
echo onlineIndicator($host,$port);
?>




ir su tuo kodu man reikia sukurti lentele. va scriptas:

   <tr>
<td>
<center><TABLE BORDER="" CELLSPACING="" CELLPADDING="" WIDTH="400" HEIGHT="" ALIGN="" VALING="" BGCOLOR="" BORDERCOLOR="" BACKGROUND="">
<CAPTION ALIGN=""></CAPTION>
<TR ALIGN="" VALIGN="" BGCOLOR="" BORDERCOLOR="">
<TD WIDTH="100" HEIGHT="" ALIGN="" VALIGN="" NOWRAP COLSPAN="" ROWSPAN="" BGCOLOR="" BORDERCOLOR="" BACKGROUND=""><center><b>Name</b></center></TD>
<TD WIDTH="" HEIGHT="" ALIGN="" VALIGN="" NOWRAP COLSPAN="" ROWSPAN="" BGCOLOR="" BORDERCOLOR="" BACKGROUND=""><center><b>IP/http://www</b></center></TD>
<TD WIDTH="" HEIGHT="" ALIGN="" VALIGN="" NOWRAP COLSPAN="" ROWSPAN="" BGCOLOR="" BORDERCOLOR="" BACKGROUND=""><center><b>STATUS</b></center></TD>
</tr>

<TD WIDTH="" HEIGHT="" ALIGN="left" VALIGN="" NOWRAP COLSPAN="" ROWSPAN="" BGCOLOR="" BORDERCOLOR="" BACKGROUND=""><center<b>GOOGLE</center></TD>
<TD WIDTH="" HEIGHT="" ALIGN="" VALIGN="" NOWRAP COLSPAN="" ROWSPAN="" BGCOLOR="" BORDERCOLOR="" BACKGROUND=""><center><a href=http://google.lt target='main'> <strong>google.lt</strong></a></center></TD>
<TD WIDTH="" HEIGHT="" ALIGN="" VALIGN="" NOWRAP COLSPAN="" ROWSPAN="" BGCOLOR="" BORDERCOLOR="" BACKGROUND=""><center>
<?php
$host = 'google.lt';
$port = '80';

function onlineIndicator($host ,$port){
$online=false;

$fp = @fsockopen($host, $port, $errno, $errstr, 1);
if($fp) {
$online=true;
}

if ($online){
return 'online';
} else {
return 'offline';
}
}
echo onlineIndicator($host,$port);
?>
</center></TD>
</tr>

</table></center></br>
</td>
</tr>




bek kai parasau ta koda pora kartu kad gautusi lentele man meta error nes kaip suprantu dvieju php negali buti. kaip padaryti kad vienam scripte butu galima surasyti daug ip / www ir portu kad rodytu juos online arba offline ?

Redagavo Lordcraft· 2007 Lap. 29 05:11:05