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

K

Kim Therkelsen

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:history.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:history.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:history.back()\">";

Sincerely
Kim Therkelsen, Denmark
 
J

Janwillem Borleffs

Kim Therkelsen said:
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:history.back() I get back to the first page but I have
to manually reload it to see the changes I have made.
....

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?

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("Location: {$_SERVER['PHP_SELF']}?rnd=".time());
exit;
}
?>


JW
 
E

Egbert Beuker

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,091
Messages
2,570,604
Members
47,223
Latest member
smithjens316

Latest Threads

Top