• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Forum Description - Online/Offline Status - PHP

#1
Hello, I own a gaming community called Chillax Gaming and I am trying to set it so before going into a section with the forums for each section, it will say on the description if the server is online or not.

For example
Code:
<?php

$httpcheck = @fsockopen('your ip address', 80, $error, $errstr, 1);
if ($httpcheck) {
      echo "<img src=\"MyOnlineImageUrl\">";
  } else {
      echo "<img src=\"MyOnlineImageUrl\">";
}
?>
Would go into the description

How would I get this to work?
It spits out
Code:
"; } ?>