Support Forums

Full Version: Help with server status script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello guys
i found a script to check if a server is online or offline
but i have to open a link to check it
i wish it could be integrated in a index.html directly
how can i do that?

this is the code

Code:
<?
$ip = "beatdj.servegame.com";
$port = "18000";
if (! $sock = @fsockopen($ip, $port, $num, $error, 5))
echo '<B><FONT COLOR=red>Offline</b></FONT>';
else{
echo '<B><FONT COLOR=lime>Online</b></FONT>';
fclose($sock);
}
?>
You could create a .htaccess file (or add the following code to it):

Code:
<Files index.html>
AddType application/x-httpd-php .html
</Files>

In the HTML file, you can include your script wherever you want it to be displayed.
PHP Code:
<?php include 'status.php'?>

Let me know if this works.
You can iframe the php script from another page too.
(11-18-2009, 07:35 PM)kab012345 Wrote: [ -> ]You could create a .htaccess file (or add the following code to it):

Code:
<Files index.html>
AddType application/x-httpd-php .html
</Files>

In the HTML file, you can include your script wherever you want it to be displayed.
PHP Code:
<?php include '/pages/server.php'?>

Let me know if this works.
Yeah it worked Big Grin

Thank you very much
(11-18-2009, 07:38 PM)Omniscient Wrote: [ -> ]You can iframe the php script from another page too.
i don't know how to >_< i will google about that


xD now i will search a script that allow to put an image
nice script
Solved, close thread plz
Woah, nice find.