Jump to content
WebFlake
  • 0

[Help] Php online server status problem.


Guest Yeezus

Question

Guest Yeezus

Hello guys today i tryed to add a online server status on my ipb forum theme to be exactly inside the boardIndexTemplate and its working but i have some problems, let me show you what i am talking about:

 

Posted Image

 

Well the server status working as you see but i added it in the Server Status box and he goes automaticly out from the theme template top left. Why? What i am doing wrong?

 

The code looks like that:

Gameserver:<php>$server="my ip address";$port="my port";$socket=@fsockopen($server,$port);if($socket==true){echo " Game: Online";}else{echo " Game: Offine";}</php>Login:<php>$server="my ip address";$port="my port";$socket=@fsockopen($server,$port);if($socket==true){echo " Login: Online";}else{echo " Login: Offine";}</php>

I am looking forword for any solutions. Thanks guys.

 

P.S: Help me :P

Edited by Yeezus
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Not quite sure what you want but this will display the code you want

<php>$server="my ip address";$port="my port";$socket=@fsockopen($server,$port);if($socket==true){$gServer = "Online";}else{$gServer = "Offine";}$server="my ip address";$port="my port";$socket=@fsockopen($server,$port);if($socket==true){$lServer = "Online";}else{$lServer = "Offine";}</php>Gameserver: {$gServer}    Login: {$lServer}

But I do not understand why you check the same thing for both answers. If that is correct I would do this

<php>$server="my ip address";$port="my port";$socket=@fsockopen($server,$port);if($socket==true){$gServer = "Online";}else{$gServer = "Offine";}</php>Gameserver: {$gServer}    Login: {$gServer}
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...