Jump to content

refresh a page from another page?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
7 replies to this topic

#1
welton122

welton122

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
hi all,

okay basically i am in need of refreshing a page from a different page.

For example, i click a link on page 1 which take me to page 2, then the first thing page 2 does is refresh page 1.

Is this possible and if yes, how can it be achieved?

Many Thanks,
J

#2
DEViANT

DEViANT

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 358 posts
Why would you want to do that?

:D You should rep+ me so that I can win :D

My Blog | Ask me!
Error : Satan did it

#3
welton122

welton122

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
because when the user clicks on a link, page 1 changes its content but the user cant see it as it hasn't refreshed

This perfectly describes what i am after:

"The "main page" will open a remote page where the user will add/edit/modify
data then on the confirmation page, there needs to be a close button.
However, before the window is closed, I want it to reload the "main window"
so that they can see the changes they made."


Reference: Remote Refresh Main then Close - JavaScript / Ajax / DHTML answers

#4
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
So "page 2" is a popup window?

#5
welton122

welton122

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
Yes page 2 is a pop up window, is it possible to do what I am after?

#6
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
I assume a simple AJAX request on page 1 speaking to a serverside script every X seconds. If the serverside script finds the database or file or whatever is changed, then update the page.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#7
welton122

welton122

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
How do i do that?

#8
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
AJAX Tutorial , just write the PHP script to echo the contents of the page from database. You can use JS's setTimout() function or whatever to update the page each second.

Alternatively you can use a meta redirect, creating an infinite loop on the same page each 10 seconds, which will refresh the new contents when page 2 is done editing.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.