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

Parašė Rytis· 2007 Lap. 29 20:11:04
#3

tikrai ne iframe :)
 <?php
function onlineIndicator($host ,$port){
$online=false;

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

if ($online){
return 'online';
} else {
return 'offline';
}
}
?><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
echo onlineIndicator('google.lt', 80);
?>
</center></TD>




<TD WIDTH="" HEIGHT="" ALIGN="left" VALIGN="" NOWRAP COLSPAN="" ROWSPAN="" BGCOLOR="" BORDERCOLOR="" BACKGROUND=""><center<b>YAHOO</center></TD>
<TD WIDTH="" HEIGHT="" ALIGN="" VALIGN="" NOWRAP COLSPAN="" ROWSPAN="" BGCOLOR="" BORDERCOLOR="" BACKGROUND=""><center><a href=http://yahoo.com target='main'> <strong>yahoo.com</strong></a></center></TD>
<TD WIDTH="" HEIGHT="" ALIGN="" VALIGN="" NOWRAP COLSPAN="" ROWSPAN="" BGCOLOR="" BORDERCOLOR="" BACKGROUND=""><center>
<?php
echo onlineIndicator('yahoo.com', 80);
?>
</center></TD>



</tr>

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




norėdamas įdėti naują serverį naudok

<TD WIDTH="" HEIGHT="" ALIGN="left" VALIGN="" NOWRAP COLSPAN="" ROWSPAN="" BGCOLOR="" BORDERCOLOR="" BACKGROUND=""><center<b>YAHOO</center></TD>
<TD WIDTH="" HEIGHT="" ALIGN="" VALIGN="" NOWRAP COLSPAN="" ROWSPAN="" BGCOLOR="" BORDERCOLOR="" BACKGROUND=""><center><a href=http://yahoo.com target='main'> <strong>yahoo.com</strong></a></center></TD>
<TD WIDTH="" HEIGHT="" ALIGN="" VALIGN="" NOWRAP COLSPAN="" ROWSPAN="" BGCOLOR="" BORDERCOLOR="" BACKGROUND=""><center>
<?php
echo onlineIndicator('yahoo.com', 80);
?>




O šitoje eilutėje įrašai serverio duomenis:
echo onlineIndicator('yahoo.com', 80);




Jei neveiks, sakyk, kokį error išmeta

Redagavo Rytis· 2007 Lap. 29 20:11:59