Refreshing a page to display change in data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill

    Refreshing a page to display change in data

    I have a page that scrolls out information from a database. When one
    of the records has been completed by the user, they press delete at
    the end of the row, and it sends the record id to a processing page
    that deletes that record from the database, then returns to the
    scrolling page. However, the deleted record still shows on the page
    until one presses the refresh tab on the browswer.

    Is there some way I can have the page refresh when the processing is
    done, so that the changes made will be reflected immidiatly, instead
    of the user having to press the refresh button themselves?

    Thanks,
    Bill
  • Geoff Berrow

    #2
    Re: Refreshing a page to display change in data

    I noticed that Message-ID:
    <8da5f4f4.03112 40846.685874ad@ posting.google. com> from Bill contained
    the following:
    [color=blue]
    >Is there some way I can have the page refresh when the processing is
    >done, so that the changes made will be reflected immidiatly, instead
    >of the user having to press the refresh button themselves?[/color]

    Include the code on the same page?

    --
    Geoff Berrow (put thecat out to email)
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    • Jonathan Lamothe

      #3
      Re: Refreshing a page to display change in data

      Geoff Berrow wrote:
      [color=blue]
      > Include the code on the same page?[/color]

      I don't think that'll make a difference. It's probably a problem with the
      browser's cache. Since PHP is processed server side, the browser wouldn't
      know the difference.

      Unfortunately, I don't know the answer either.

      --
      Jonathan Lamothe
      Founder of the Anime Void.

      Comment

      • Christian Debt Man

        #4
        Re: Refreshing a page to display change in data

        Bill (8.842% quality rating):[color=blue]
        >
        > Is there some way I can have the page refresh when the processing is
        > done, so that the changes made will be reflected immidiatly, instead
        > of the user having to press the refresh button themselves?[/color]

        It sounds like the user's browser is caching the page, so when it loads
        the page (presumably at the same URL) again, it just loads from the
        cache instead of getting the updated version. If you want the page not
        to cache, you can add specific headers. Here's something like what I use:

        header("Expires : Sat, 10 Jan 1970 00:00:00 GMT");
        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
        header("Cache-Control: no-store, no-cache, must-revalidate");
        header("Cache-Control: post-check=0, pre-check=0", false);
        header("Pragma: no-cache");
        header("Content-type: text/html");

        And for good measure, in the <head> tag of your html:

        <meta http-equiv='Pragma' content='no-cache'>
        <meta http-equiv='expires' content='0'>

        These headers should make it so that the page is always considered expired
        and will be loaded fresh rather than from the cache every time the URL is
        accessed in a browser. Note that you probably shouldn't use the above
        for relatively static pages because it wastes bandwidth to have users
        reloading the same thing over and over.

        /joe
        --
        In the emo house, a router is Santa-like. Kyle Randolph practically rubs
        git.talk.phatjo e. Tanya Stone processes Matt Magnasco's choad from Norm,
        and then digs on the Steamer?? A colostomy bag is sketchy!

        Comment

        • Geoff Berrow

          #5
          Re: Refreshing a page to display change in data

          I noticed that Message-ID: <sTuwb.4519$dt2 .480266@news20. bellglobal.com>
          from Jonathan Lamothe contained the following:
          [color=blue][color=green]
          >> Include the code on the same page?[/color]
          >
          >I don't think that'll make a difference. It's probably a problem with the
          >browser's cache. Since PHP is processed server side, the browser wouldn't
          >know the difference.[/color]

          It will automatically refresh the page.



          --
          Geoff Berrow (put thecat out to email)
          It's only Usenet, no one dies.
          My opinions, not the committee's, mine.
          Simple RFDs http://www.ckdog.co.uk/rfdmaker/

          Comment

          Working...