Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with server status script
#1
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);
}
?>
Reply
#2
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.
Reply
#3
You can iframe the php script from another page too.
Superman I am here to rescue you.
This is Support Forums not Support PMs.  Do not PM me for support unless it's private and site related.
Reply
#4
(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
Reply
#5
nice script
Reply
#6
Solved, close thread plz
Reply
#7
Woah, nice find.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  php form script with upload script help andrewjs18 4 3,340 10-07-2010, 11:46 AM
Last Post: JMK940

Forum Jump:


Users browsing this thread: 1 Guest(s)