Jump to content

Status Script


lordicon

Recommended Posts

Ok I know what I want but I am new to PhP, I know html and never worked with PhP befor so if someone can help me or explain steps to help me get this done I thank thee.

 

What I need is a script that will scan my gaming servers IP and tell when the server is offline or online with a display picture. Now I know a bit from browsing these forums for my answer but I didnt get exact help that I need.

 

This is one example of the code I need that I found on these forums.

<?php
$serverip = $_GET['serverip'];
$serverport = $_GET['serverport'];
if (isset($serverip))
{
if (isset($serverport))
    {
    	// here will be the scripts that checks the online status.
    }
}
?>

 

Now the thing is I have 3 servers I have to do a check on, One is a log in server other two are the games servers. I need this code to do a check on all 3 servers when someone visits the web page for checking the status.

 

One of my problems is I do not know any PhP and I dont even now how to add the PhP to my index.html file so that it displays and works.

 

If someone can please help me I thank thee.

Link to comment
Share on other sites

if(@fopen("http://yourserver/image.gif", "r"))
   echo 'found'; 
else 
   echo 'not found';

 

 

actually this code trys to open a picture on your server you wanna scan!!!

if you have a webserver enabled on your gaming server this script will do the job.

on line 1 just replace the "yourserver" part with your gameserver's ipadress and thats is!

if its not a webserver this wont do!

 

i dont think the $_GET variable will work cause it will look for $_GET variables belonging to the person visiting your website.

first thing i would think of is trying to have your gameserver constantly sending a $_GET variable message towards your webserver.

about every minute 1 message.

then when your webserver gets this info it will put a marker with a TIME value in a file or in a database.

and you can have your script check for the time each time a the script ask for the status:).

if the last mark has been longer then 1 minute your know the server is offline!!!

atleast i think this will do the job.

 

hope this help

 

greetingz

 

Silverado

Link to comment
Share on other sites

What i am doing is making a web site that is not on the gamesever, So i need to make a script that checks the ip and port of this gameserver to see if it is active then to display the right picture showing active when it is up and not active when it is down, I have the pictures i want to use and i have already placed them on my web page i just need a php script that will update when the person viewing goes to check the status, So i need the right script and need to know how to add it to a simple html to work. so another words i want to place the php in my index.html so when the user looks at the page it updates on its own depending on the servers status. I dont know how to add it to a html as i dont know php, So the html when viewed needs to check the ip of the gaming server and display if it is online or offline. and how do i get the php to work inside the html?

Link to comment
Share on other sites

This is what I have so far. Its just a simple html I put in to show what I mean, Its not what I am using

<html>
   <head>
      <title>
         Lineage 2 C4 Server
      </title>
   
</head>
   <body background="http://home.comcast.net/~jaynight2001/body_background.jpg" bgcolor="#C0C0C0" text="#FFFFFF" alink="#FF0000" vlink="#FF00FF" link="#0000FF">
<br><Center>LINEAGE 2 C4 SERVER</center><br>
<?php

$socket = fsockopen("IP HERE", PORT HERE, $errno, $errstr, 20);
if (!$socket) 
{
echo "The server is currently Offline  <img src='down.png' alt='Server Status: DOWN'>";
} 
else 
{
echo "The server is currently Online  <img src='up.png' alt='Server Status: DOWN'>";
}
?> 
<center>
<a href="http://home.comcast.net/~jaynight2001/pic1.html"><img src="http://home.comcast.net/~jaynight2001/Image_1.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic2.html"><img src="http://home.comcast.net/~jaynight2001/Image_2.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic3.html"><img src="http://home.comcast.net/~jaynight2001/Image_3.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic4.html"><img src="http://home.comcast.net/~jaynight2001/Image_4.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic5.html"><img src="http://home.comcast.net/~jaynight2001/Image_5.jpg" border="0"></a><br>
<a href="http://home.comcast.net/~jaynight2001/pic6.html"><img src="http://home.comcast.net/~jaynight2001/Image_6.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic7.html"><img src="http://home.comcast.net/~jaynight2001/Image_7.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic8.html"><img src="http://home.comcast.net/~jaynight2001/Image_8.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic9.html"><img src="http://home.comcast.net/~jaynight2001/Image_9.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic10.html"><img src="http://home.comcast.net/~jaynight2001/Image_10.jpg" border="0"></a><br>
<a href="http://home.comcast.net/~jaynight2001/pic11.html"><img src="http://home.comcast.net/~jaynight2001/Image_11.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic12.html"><img src="http://home.comcast.net/~jaynight2001/Image_12.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic13.html"><img src="http://home.comcast.net/~jaynight2001/Image_13.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic14.html"><img src="http://home.comcast.net/~jaynight2001/Image_14.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic15.html"><img src="http://home.comcast.net/~jaynight2001/Image_15.jpg" border="0"></a><br>
<a href="http://home.comcast.net/~jaynight2001/pic16.html"><img src="http://home.comcast.net/~jaynight2001/Image_16.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic17.html"><img src="http://home.comcast.net/~jaynight2001/Image_17.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic18.html"><img src="http://home.comcast.net/~jaynight2001/Image_18.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic19.html"><img src="http://home.comcast.net/~jaynight2001/Image_19.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic20.html"><img src="http://home.comcast.net/~jaynight2001/Image_20.jpg" border="0"></a><br>
<a href="http://home.comcast.net/~jaynight2001/pic21.html"><img src="http://home.comcast.net/~jaynight2001/Image_21.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic22.html"><img src="http://home.comcast.net/~jaynight2001/Image_22.jpg" border="0"></a>

<br><a href="http://www2.clustrmaps.com/counter/maps.php?url=http://home.comcast.net/~jaynight2001" id="clustrMapsLink"><img src="http://www2.clustrmaps.com/counter/index2.php?url=http://home.comcast.net/~jaynight2001" style="border:1px solid;" alt="Locations of visitors to this page" title="Locations of visitors to this page" id="clustrMapsImg" onError="this.onError=null; this.src='http://clustrmaps.com/images/clustrmaps-back-soon.jpg'; document.getElementById('clustrMapsLink').href='http://clustrmaps.com'" />
</a>
</center>
</body>
</html>

Link to comment
Share on other sites

I desided to go with this but it still dont display the img or work at all, I even changed the index.html to be index.php and it still dont show up.

<html>
   <head>
      <title>
         Lineage 2 C4 Server
      </title>
   
</head>
   <body background="http://home.comcast.net/~jaynight2001/body_background.jpg" bgcolor="#C0C0C0" text="#FFFFFF" alink="#FF0000" vlink="#FF00FF" link="#0000FF">
<br><Center>LINEAGE 2 C4 SERVER</center><br>
<?php
$serverip = $_GET['IP'];
$serverport = $_GET['PORT'];
if (isset($serverip))
{
if (isset($serverport))
    {
    	if(@fopen("up.gif", "r"))
   echo 'found'; 
else 
	if(@fopen("down.gif", "r"))
   echo 'not found';
    }
}
?>
<center>
<a href="http://home.comcast.net/~jaynight2001/pic1.html"><img src="http://home.comcast.net/~jaynight2001/Image_1.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic2.html"><img src="http://home.comcast.net/~jaynight2001/Image_2.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic3.html"><img src="http://home.comcast.net/~jaynight2001/Image_3.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic4.html"><img src="http://home.comcast.net/~jaynight2001/Image_4.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic5.html"><img src="http://home.comcast.net/~jaynight2001/Image_5.jpg" border="0"></a><br>
<a href="http://home.comcast.net/~jaynight2001/pic6.html"><img src="http://home.comcast.net/~jaynight2001/Image_6.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic7.html"><img src="http://home.comcast.net/~jaynight2001/Image_7.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic8.html"><img src="http://home.comcast.net/~jaynight2001/Image_8.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic9.html"><img src="http://home.comcast.net/~jaynight2001/Image_9.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic10.html"><img src="http://home.comcast.net/~jaynight2001/Image_10.jpg" border="0"></a><br>
<a href="http://home.comcast.net/~jaynight2001/pic11.html"><img src="http://home.comcast.net/~jaynight2001/Image_11.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic12.html"><img src="http://home.comcast.net/~jaynight2001/Image_12.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic13.html"><img src="http://home.comcast.net/~jaynight2001/Image_13.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic14.html"><img src="http://home.comcast.net/~jaynight2001/Image_14.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic15.html"><img src="http://home.comcast.net/~jaynight2001/Image_15.jpg" border="0"></a><br>
<a href="http://home.comcast.net/~jaynight2001/pic16.html"><img src="http://home.comcast.net/~jaynight2001/Image_16.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic17.html"><img src="http://home.comcast.net/~jaynight2001/Image_17.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic18.html"><img src="http://home.comcast.net/~jaynight2001/Image_18.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic19.html"><img src="http://home.comcast.net/~jaynight2001/Image_19.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic20.html"><img src="http://home.comcast.net/~jaynight2001/Image_20.jpg" border="0"></a><br>
<a href="http://home.comcast.net/~jaynight2001/pic21.html"><img src="http://home.comcast.net/~jaynight2001/Image_21.jpg" border="0"></a>
<a href="http://home.comcast.net/~jaynight2001/pic22.html"><img src="http://home.comcast.net/~jaynight2001/Image_22.jpg" border="0"></a>

<br><a href="http://www2.clustrmaps.com/counter/maps.php?url=http://home.comcast.net/~jaynight2001" id="clustrMapsLink"><img src="http://www2.clustrmaps.com/counter/index2.php?url=http://home.comcast.net/~jaynight2001" style="border:1px solid;" alt="Locations of visitors to this page" title="Locations of visitors to this page" id="clustrMapsImg" onError="this.onError=null; this.src='http://clustrmaps.com/images/clustrmaps-back-soon.jpg'; document.getElementById('clustrMapsLink').href='http://clustrmaps.com'" />
</a>
</center>
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.