back() and reload() at the same time?

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

    back() and reload() at the same time?

    Hi!

    By pressing a button I am directed from one page to another. At the second
    page some things displayed on the first page are changed and now I want to
    go back to the first page again. The pages are written in php.

    If I use javascript:hist ory.back() I get back to the first page but I have
    to manually reload it to see the changes I have made.

    The solution could be:
    echo "<meta http-equiv=\"refresh \"
    content=\"0;url =firstpage.php? op=view&id=$id& ...&...&....\"> ";
    But I have to do a lot of work to get all the options (e.g. op=view&...).

    Is there anyway I can use javascript to go back to the first page and force
    it to reload, so that I don't have to reload it my self?

    Or is there some way I can read out what is in javascript:hist ory.back() so
    that I could place it in the above mentioned solution? It doesn't seem to
    work if I just do the following:
    echo "<meta http-equiv=\"refresh \"
    content=\"0;url =javascript:his tory.back()\">" ;

    Sincerely
    Kim Therkelsen, Denmark


  • Janwillem Borleffs

    #2
    Re: back() and reload() at the same time?


    "Kim Therkelsen" <kthe00@control .auc.dk> schreef in bericht
    news:bk1pho$g26 $1@sunsite.dk.. .[color=blue]
    >
    > By pressing a button I am directed from one page to another. At the second
    > page some things displayed on the first page are changed and now I want to
    > go back to the first page again. The pages are written in php.
    >
    > If I use javascript:hist ory.back() I get back to the first page but I have
    > to manually reload it to see the changes I have made.
    >[/color]
    ....[color=blue]
    >
    > Is there anyway I can use javascript to go back to the first page and[/color]
    force[color=blue]
    > it to reload, so that I don't have to reload it my self?
    >[/color]

    Instead of using JavaScript, you could use a meta cache control header at
    the top of firstpage.php.

    You could also start firstpage.php with a parameter check, e.g. when the
    parameter doesn't exist, throw in a 302 header to append this parameter:

    <?
    if (!isset($_GET['rnd'])) {
    header("Locatio n: {$_SERVER['PHP_SELF']}?rnd=".time()) ;
    exit;
    }
    ?>


    JW



    Comment

    • Egbert Beuker

      #3
      Re: back() and reload() at the same time?

      maybe you could use
      "window.navigat e(someURL)"
      on the second page to navigate "back" to the first page?


      "Kim Therkelsen" <kthe00@control .auc.dk> wrote in message
      news:bk1pho$g26 $1@sunsite.dk.. .[color=blue]
      > Hi!
      >
      > By pressing a button I am directed from one page to another. At the second
      > page some things displayed on the first page are changed and now I want to
      > go back to the first page again. The pages are written in php.
      >
      > If I use javascript:hist ory.back() I get back to the first page but I have
      > to manually reload it to see the changes I have made.
      >
      > The solution could be:
      > echo "<meta http-equiv=\"refresh \"
      > content=\"0;url =firstpage.php? op=view&id=$id& ...&...&....\"> ";
      > But I have to do a lot of work to get all the options (e.g. op=view&...).
      >
      > Is there anyway I can use javascript to go back to the first page and[/color]
      force[color=blue]
      > it to reload, so that I don't have to reload it my self?
      >
      > Or is there some way I can read out what is in javascript:hist ory.back()[/color]
      so[color=blue]
      > that I could place it in the above mentioned solution? It doesn't seem to
      > work if I just do the following:
      > echo "<meta http-equiv=\"refresh \"
      > content=\"0;url =javascript:his tory.back()\">" ;
      >
      > Sincerely
      > Kim Therkelsen, Denmark
      >
      >[/color]


      Comment

      Working...