473,769 Members | 2,019 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to refresh my page every ten seconds?

3 New Member
can someone help me with code to refresh my PHP pages every ten seconds?
Mar 4 '08 #1
16 6882
ronverdonk
4,258 Recognized Expert Specialist
can someone help me with code to refresh my PHP pages every ten seconds?
There are no PHP pages, just HTML pages, 'constructed' by PHP and send to the client.

You could use statement
Expand|Select|Wrap|Line Numbers
  1. <meta http-equiv="refresh" content="10">
at the top of your html page.

This is a HTML and (maybe later) JavaScript question, so I will move it to that form.
Mar 4 '08 #2
hsriat
1,654 Recognized Expert Top Contributor
can someone help me with code to refresh my PHP pages every ten seconds?
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.
Expand|Select|Wrap|Line Numbers
  1. function refreshAfter10() {
  2.     window.setTimeout("refreshPage()",10000); //10000micro sec = 10 sec
  3. }
  4. function refreshPage() {
  5.     window.location.replace('http://www.yoursite.com');
  6. }
Call refreshAfter10( ) onload of body.
Mar 4 '08 #3
Hemavathi
3 New Member
[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.
Expand|Select|Wrap|Line Numbers
  1. function refreshAfter10() {
  2.     window.setTimeout("refreshPage()",10000); //10000micro sec = 10 sec
  3. }
  4. function refreshPage() {
  5.     window.location.replace('http://www.yoursite.com');
  6. }
Call refreshAfter10( ) onload of body.[/QUOte

How could I check whether it is refreshed?????
Mar 4 '08 #4
ronverdonk
4,258 Recognized Expert Specialist
How could I check whether it is refreshed?????
Display your screen and see it flicker every 10 seconds. How else do you suggest you can/want to check that?

Ronald
Mar 4 '08 #5
hsriat
1,654 Recognized Expert Top Contributor
Display your screen and see it flicker every 10 seconds. How else do you suggest you can/want to check that?

Ronald
I think that the refresh goes too fast that she's not able to find out if its refreshed.

@Hemavathi
Add alert('I\'m Refreshed'); in the onload of the body. And see if its displayed after 10 sec.
Mar 4 '08 #6
ronverdonk
4,258 Recognized Expert Specialist
My screen is probably too slow. I notice a refresh being done. Time to buy a faster one.

Ronald
Mar 4 '08 #7
hsriat
1,654 Recognized Expert Top Contributor
My screen is probably too slow. I notice a refresh being done. Time to buy a faster one.

Ronald
:D
Even mine is not that fast. I just guessed that may be her screen is, along with her server.
Mar 4 '08 #8
susee
10 New Member
is thr any equivalent statement in php to refresh the content like meta tag(<meta http-equiv="refresh" content="10">) in HTML?
Mar 5 '08 #9
Hemavathi
3 New Member
yeah i too look for the same....
Mar 5 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1190
by: Mark Andrews | last post by:
What would be the best way to build a little asp page that: displays http://www.yahoo.com waits for 45 seconds displays http://www.google.com loops forever Thanks in advance, Mark
7
40206
by: Willem | last post by:
Can someone tell me how I can get a page(any page) on the Internet to refresh automatically every 5 minutes. I was thinking along the lines of having a HTML file on my C-drive with JavaScript to do so. It should be possible, Right? I don't know much about JavaScript. Thanks for the help.
0
1988
by: Marcus | last post by:
Hello! I'm buildning a webpage in ASP.NET using Visual Basic. The page contains a datagrid, a dropdownlist, some textboxes and a couple of buttons. The datagrid displays barcodes from a table in a database (Sql Server 2000). I want to automatic update the datagrid when new new posts arrives in the table. Before the datagird is updated, the choosen index from the
3
2196
by: IGotYourDotNet | last post by:
Let me just start by saying taken over someones else code that they wrote just for them to understand(no comments, documentation NOTHING) is a task on in itself. anyway, i have a page that needs to be refreshed every 10 seconds but not looses the item selected in the drop down, how and can it be done? example: drop down user selects Football i want all the scores to be refreshed every 10 seconds but not loose football as the selection....
8
5880
by: TS | last post by:
Im in a web page and call an asynchronous method in business class. the call back method is in the web page. When page processes, it runs thru code begins invoking the method then the page unloads. When the callback method is raised, only the method in the web page is run and the page never refreshes, it seems it all happens on the server side. I am trying to refresh the constrols on the page inside the callback method, but when id...
4
2819
by: Phil | last post by:
Hi. A fairly basic sort of 'direction to go in' question of the type that can be hard to find an answer to! I am using ASP.NET (framework 1.1) to present data on web pages (IIS 5.0 / IE6) from tables (in SQL Server 8). What are the best methods of getting the web page being viewed to update automatically when data in the table changes? Not necessarily a detailed answer, but a good pointer please.
10
32884
by: phforum | last post by:
Hi, I wrote a PHP page for user input the information to search the database. And the database data will update every second. I want to set the auto refresh to get the data from database every minute. But the page always display the dialog box ask me to resend the information. How to disable this warning message. I using POST and REQUEST to get the data from user input page. Thanks all
1
1868
by: jonathan184 | last post by:
how to let ajax refresh a page every few secs Hi I got a php page that did that is being fed data that changes every few secs, i need some help in doing some code in letting the page aut refresh it self without refreshing the whole browser. id id it php and flickers, so could somebody show me example code how i could do this please. Thanks in advance
2
1792
by: szy1 | last post by:
Hello, Im using very basic script to show records form database(mysql) and link that remove the record. And the problem is when i click delete link IE show same page with link 'delete' marked as visited, i can only click one more time or hit F5 to get actual results.(without record that i clicked to remove) How i can make this script to show actual content immediatly
3
9883
by: tvnaidu | last post by:
How to auto refresh page for every 3 minutes by passing command part of URL?. I need to refresh one page automatically by passing that refresh command part of url, for example if I want to refresh my-own-web-page.com: some URL like this to auto reload? http://www.my-own-web-page.com?auto-refresh=3
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9420
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9851
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7401
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2811
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.