can someone help me with code to refresh my PHP pages every ten seconds?
how to refresh my page every ten seconds?
Collapse
X
-
There are no PHP pages, just HTML pages, 'constructed' by PHP and send to the client.Originally posted by Hemavathican someone help me with code to refresh my PHP pages every ten seconds?
You could use statement[code=html]<meta http-equiv="refresh" content="10">[/code]at the top of your html page.
This is a HTML and (maybe later) JavaScript question, so I will move it to that form. -
Either use the meta tag[html]<meta http-equiv="refresh" content="10" />Originally posted by Hemavathican someone help me with code to refresh my PHP pages every ten seconds?
<meta http-equiv="cache-control" content="no-cache" />[/html]Or use setTimeout to call a function which refreshes your page.[CODE=javascript]function refreshAfter10( ) {
window.setTimeo ut("refreshPage ()",10000); //10000micro sec = 10 sec
}
function refreshPage() {
window.location .replace('http://www.yoursite.co m');
}[/code]Call refreshAfter10( ) onload of body.Comment
-
[QUOTE=hsriat]Either use the meta tag[html]<meta http-equiv="refresh" content="10" />
<meta http-equiv="cache-control" content="no-cache" />[/html]Or use setTimeout to call a function which refreshes your page.[CODE=javascript]function refreshAfter10( ) {
window.setTimeo ut("refreshPage ()",10000); //10000micro sec = 10 sec
}
function refreshPage() {
window.location .replace('http://www.yoursite.co m');
}[/code]Call refreshAfter10( ) onload of body.[/QUOte
How could I check whether it is refreshed?????Comment
-
Display your screen and see it flicker every 10 seconds. How else do you suggest you can/want to check that?Originally posted by HemavathiHow could I check whether it is refreshed?????
RonaldComment
-
I think that the refresh goes too fast that she's not able to find out if its refreshed.Originally posted by ronverdonkDisplay your screen and see it flicker every 10 seconds. How else do you suggest you can/want to check that?
Ronald
@Hemavathi
Add alert('I\'m Refreshed'); in the onload of the body. And see if its displayed after 10 sec.Comment
-
Comment
-
Not really. PHP is a server side language, HTML and JavaScript run client side. And the latter has to be refreshed. So if you could force PHP to send a new HTML page to the client, you could. But I'd stick with HTML/JavaScript solution if I were you.Originally posted by suseeis thr any equivalent statement in php to refresh the content like meta tag(<meta http-equiv="refresh" content="10">) in HTML?
RonaldComment
-
Let me explain in detail, I ve a HTML page in which I display some values reading from an XML which change dynamically.I have used PHP to read from the xml. Now my problem is to get the xml entries whenever i refresh my page. How can i do this?Originally posted by ronverdonkNot really. PHP is a server side language, HTML and JavaScript run client side. And the latter has to be refreshed. So if you could force PHP to send a new HTML page to the client, you could. But I'd stick with HTML/JavaScript solution if I were you.
RonaldComment
-
Please tell in details how are you doing it... with some code.Originally posted by suseeLet me explain in detail, I ve a HTML page in which I display some values reading from an XML which change dynamically.I have used PHP to read from the xml. Now my problem is to get the xml entries whenever i refresh my page. How can i do this?Comment
-
You are not talking about an RSS feed, are you?Let me explain in detail, I ve a HTML page in which I display some values reading from an XML which change dynamically.I have used PHP to read from the xml. Now my problem is to get the xml entries whenever i refresh my page. How can i do this?
RonaldComment
Comment