Results 1 to 4 of 4

Thread: Auto refresh page

  1. #1
    Member
    Join Date
    Dec 2002
    Posts
    58

    Question Auto refresh page

    Hello friends

    i have seen in some sites that when a database is updated, the page is automatically refreshed without the user pressing refresh button. I saw this in espnstar.com, when score changes, a little popup window that shows the score automatically updates. I can't find the method by which it is done though i tried in vain. Is this done by a specific tag? what is its method .. pls give me some ideas
    God is Love

  2. #2
    Senior Member
    Join Date
    Sep 2001
    Posts
    201
    Depending on the language used to generate the page you can send http headers to the browser.

  3. #3
    Member
    Join Date
    Dec 2002
    Posts
    58
    Can you refer any links plz
    God is Love

  4. #4
    Senior Member
    Join Date
    Feb 2003
    Posts
    282
    Database servers such as my-sql are commonly driven by php, or cgi scripts. Every time your web browser such as Netscape trys to view the page, the request is sent to the server. The server then processes the php script to create a new page for you to view. The page is sent back to you where your web browser displays it. As a result you are getting a new version of the page each time, which is the dynamic nature of php. To understand it further, this server-client interaction that alows scripts to be processed server side and sent dynamicaly to the user is called the Common Gateway Interface.

    The refresh can be done through the http headers that are sent or useing meta tags. Giveing a meta tag such as:

    <meta http-equiv="refresh" content="5">

    will force a refresh after an alocated time elapsed. Useing http headers simular to the following you can achive a forced refresh:

    Pragma: no-cache
    Refresh: 60

    no-cache tells the browser not to store the page in cache, and refresh causes the page to refresh after the alocated time.

    To understand this properly you would need to learn some php or cgi. But To give you an idea I hope this helps.

    EDIT: How this differs from standard HTML is that with a static HTML page, every time your web browser makes the request to view the page, the same file is sent each time, and because the file is the same each time nothing changes. Whereas with php the page is re-writen each time with the new information so that you get the updated version each time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •