1
           
            
                
     
    
    I have the code that I've put in an HTML block that works fantastic in preview, but prints the code on the actual page. Any ideas what I can do to fix that? 
 $smonXML = 'http://www.serverspy.net/bin/smonXml.mpl?mid=32285'; 
$smon = Array(); 
global $smon; 
$smon['PLAYERS'] = Array(); 
$smon['DETAILS'] = Array(); 
$smon['RULES'] = Array(); 
$smon['SERVERSPY'] = Array(); 
 
function startElement($parser, $tagName, $attrs) { 
    global $smon; 
    if ($tagName == 'PLAYERS'){ 
        $smon['PLAYERS'][$attrs['NAME']] = Array(); 
        $smon['PLAYERS'][$attrs['NAME']]['CONNECTED'] = $attrs['CONNECTED']; 
        $smon['PLAYERS'][$attrs['NAME']]['KILLS'] = $attrs['KILLS']; 
 
    } elseif ($tagName == 'SERVERSPY'){ 
        $smon['SERVERSPY'][$attrs['NAME']] = $attrs['VALUE']; 
 
    } elseif ($tagName == 'RULES'){ 
        $smon['RULES'][$attrs['NAME']] = $attrs['VALUE']; 
     
    } elseif ($tagName == 'DETAILS'){ 
        $smon['DETAILS'][$attrs['NAME']] = $attrs['VALUE']; 
    } 
 
//    while (list ($key, $val) = each ($attrs)) { 
//    } // end while 
} 
 
 
function characterData($parser, $data) {     
    // no wrapped data used 
} 
 
 
function endElement($parser, $tagName) {     
    // no wrapped data used 
} 
 
// Create an XML parser 
$xml_parser = xml_parser_create(); 
 
// Set the functions to handle opening and closing tags 
xml_set_element_handler($xml_parser, "startElement", "endElement"); 
 
// Set the function to handle blocks of character data 
xml_set_character_data_handler($xml_parser, "characterData"); 
 
// Open the XML file for reading 
$fp = fopen($smonXML,"r")  or die("Error reading ServerSpy.net XML feed. Either the URL is invalid or the XML feed has been updated."); 
 
// Read the XML file 4KB at a time 
while ($data = fread($fp, 4096))     
// Parse each 4KB chunk with the XML parser created above 
xml_parse($xml_parser, $data, feof($fp))  
        or die(sprintf("XML error: %s at line %d", 
            xml_error_string(xml_get_error_code($xml_parser)), 
                xml_get_current_line_number($xml_parser))); 
// Close the XML filef 
fclose($fp); 
 
// Free up memory used by the XML parser 
xml_parser_free($xml_parser); 
 
// Details 
print "".$smon['DETAILS']['name']." Server Details
n"; 
while (list ($key, $val) = each ($smon['DETAILS'])){ 
    print "$key = $val
n"; 
} 
print "
"; 
 
// Players 
print "Server Rules
n"; 
while (list ($key, $val) = each ($smon['RULES'])){ 
    print "$key = $val
n"; 
} 
print "
"; 
 
// Rules 
print "Players (player-kills-connected/ping)
n"; 
while (list ($key, $val) = each ($smon['PLAYERS'])){ 
    print "$key  - ".$smon['PLAYERS'][$key]['KILLS']." - ".$smon['PLAYERS'][$key]['CONNECTED']."
n"; 
} 
 
// end of file 
 
?>  
I just looked at the code block and the URL is showing up as a link, but rest assured it is NOT like that in the actual code block.