so i have a php code to track my game server if it's online or offline. But i tried with html inside the echo but it outputs the famous T_String error.
My code:
<table border="1" bgcolor="#fff">
<tr>
<td>SERVER</td>
<?php
$fp = fsockopen("some ip", an port, $errno, $errstr);
if (!$fp)
{
echo "<h1><td style="background-color:red">Offline</td></h1>";
}
else;
{
echo "<h1><td style="background-color:green">Online</td></h1>";
fclose($fp);
}
?>
</tr>
</table>
It says on line 26 which is echo "<h1><td style="background-color:red">Offline</td></h1>";
Offline
";` or use single quotes `echo "Offline
";` Or.. or... or. There's another way, but this will suffice; for now. Oh, and the semi-colon in `else;` remove it. – Funk Forty Niner Jan 20 '14 at 15:36