MyBB Community Forums

Full Version: PHP in header template?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Yes, I wanna fit in this code into the header template:

<?php 


function check($server,$port=8585,$timeout=3) { 
$PingIT = fsockopen($server, $port, $timeout); 
if ( ! $PingIT ) { 
return FALSE; 
} else { 
return TRUE; }} 

$server = '109.234.77.20'; 
$status = check($server); 

if( $status ) { 
$Result1 = "<font color='green'>online</font>"; 
} else { 
$Result1 = "<font color='red'>offline</font>"; } 
?> 
<center><?php echo "MapleStory "; ?> is  <?php echo $Result1;?></center>

So how to do this? I tried add it to the header template but seems like the PHP aren't working there?
(2014-12-24, 12:01 AM)geazy Wrote: [ -> ]Try downloading this http://mybbhacks.zingaburga.com/showthread.php?tid=260

thank you! it works Big Grin