Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 20:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Server Status Auto Refresh

Discussion on Server Status Auto Refresh within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
F i n c h i's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 422
Server Status Auto Refresh

I have:

- index.php (my homepage)
- status.php (the code that shows the server status is inside)

I included the "status.php" in the "index.php" file, via "include" PHP-tag; I want the "status.php" file to refresh (inside the index.php) every x seconds without refreshing the whole page (index.php)

F i n c h i is offline  
Old 07/30/2011, 01:20   #2
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
Look up "refresh html" on Google or any other search engine.
This really isn't conquer related either...
Spirited is offline  
Old 07/30/2011, 01:24   #3
 
F i n c h i's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 422
If I add
Code:
<meta http-equiv="refresh" content="5" >
in "status.php" and I go to "index.php", the whole page (index.php) refresh, I want it just to refresh the status I included.
F i n c h i is offline  
Old 07/30/2011, 01:32   #4
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
Quote:
Originally Posted by F i n c h i View Post
If I add
Code:
<meta http-equiv="refresh" content="5" >
in "status.php" and I go to "index.php", the whole page (index.php) refresh, I want it just to refresh the status I included.
You need to use it as a separate element then (such as javascript).
Again... this really isn't conquer related.
Spirited is offline  
Old 07/30/2011, 02:07   #5
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
Ajax!
.Kinshi is offline  
Thanks
2 Users
Old 07/30/2011, 02:13   #6
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Quote:
Originally Posted by .Kinshi View Post
Ajax!
Right, when I was going to post it.
BaussHacker is offline  
Old 07/30/2011, 02:15   #7
 
elite*gold: 0
Join Date: May 2011
Posts: 168
Received Thanks: 33
Code:
function iRefresh(timeoutPeriod) {
setTimeout(load(),timeoutPeriod);
}
Code:
iRefresh(10000)
You could try that in the php

Google <3
zTek is offline  
Thanks
1 User
Old 07/30/2011, 02:37   #8
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
Here's an example code with JQuery calling Ajax

You can change how fast it refreshes by changing the value in
Code:
window.setTimeout(update, 10000);
It should all be pretty straight forward, even if you don't know anything about HTML or JQuery.
GOOGLE
Attached Files
File Type: zip status.zip (3.5 KB, 49 views)
.Kinshi is offline  
Thanks
3 Users
Old 07/30/2011, 02:44   #9
 
F i n c h i's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 422
Well, thank you guys, I got it working, I've got this one and its working fine.
Request close!

Code:
<!--<meta http-equiv="refresh" content="5" >-->
<html>
<body>

<script type="text/javascript">
function Ajax(){
var xmlHttp;
	try{	
		xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
	}
	catch (e){
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
		}
		catch (e){
		    try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e){
				alert("No AJAX!?");
				return false;
			}
		}
	}

xmlHttp.onreadystatechange=function(){
	if(xmlHttp.readyState==4){
		document.getElementById('ReloadThis').innerHTML=xmlHttp.responseText;
		setTimeout('Ajax()',10000);
	}
}
xmlHttp.open("GET","status.php",true);
xmlHttp.send(null);
}

window.onload=function(){
	setTimeout('Ajax()',1);
}
</script>

<div id="ReloadThis"></div>

</body>
</html>
F i n c h i is offline  
Old 07/30/2011, 14:08   #10
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
As mentioned earlier, this doesn't really belong in conquer related sections. It's a generic html/programming question and would be better suited to sections specifically relating to such things.

Glad you got your answer ^^
pro4never is offline  
Thanks
1 User
Closed Thread


Similar Threads Similar Threads
c++ auto refresh/reload
01/24/2011 - C/C++ - 4 Replies
How i can auto refresh screen? this code system("CLS"); clear screen and how i can load screen? or how i can reload offset rezultat?
server refresh today might be a problem
11/18/2010 - Battle of the Immortals - 1 Replies
jus now the server has been shut down i jus hope the current working exploits dont get jammed as if it happen swe might need a new bot
Auto pot+Remove Upnormal status
06/17/2010 - Aion - 1 Replies
We Should Work on a way to Auto pot When HP reaches Certain Level....Also A way To Auto Use Healing potion to remove upnormal status..any help will be appreciated.
[PHP/SQL] Auto refresh
03/25/2009 - Web Development - 0 Replies
Hallo, ich mache z.Z ein eigenes Browsergame. Der Fall um den ich mir von Anfang an schon Gedanken gemacht hab ist nun eingetroffen. Beispiel: Produktion 5/std Rohstofffeld wird ausgebaut(erhöht die produktion um 10/std wenn fetig)... Bis jetzt hab ich es so aufgebaut das die momentane Zeit+Bauzeit gemerkt wird und dann einfach ne if Abfrage wenn die aktuelle Zeit>=Bauzeit dann soll das Feld halt eingetragen werden und die Produktion +10... Das Problem an der Sache kann man sich ja...
[Server Status] Server Status Programs From A Couple Servers.
11/05/2008 - Conquer Online 2 - 9 Replies
Hey i dont know in what section to post it so i hope that the mods will move it to the good section but i made this server status program i will make later more server status programs for other servers. PhoenixCo: Server Checker Qonquer Qonquer Server Checker Screenshot: http://i286.photobucket.com/albums/ll115/aschwinh /sdfsdfsdf.jpg



All times are GMT +1. The time now is 20:36.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.