tags:

views:

39

answers:

2

Hi,

my title may not be clear. But basically what I want to do is:

There will be a link in my php form

<a href="somepage.php" target=_blank>Update</a>

when the user clicks on the link, a new browser window opens and allows him to select some options. There will be close button in that window. When he clicks on that 'close' button, there is a post form from where the parent window should get the selected value. When I get that selected value from that child browser window, how I am going to refresh parent browser window to reflect what user has selected in child window?

Environment : PHP

Can anyone give me some idea?

+3  A: 

As far as I know you can't refresh a parent window using PHP (or, more correctly, pure HTML). You will need a bit of Javascript in your onLoad event:

window.opener.location.reload(); // Refresh
- or -
window.opener.location.href = "targetpage.php"; // Redirect

You would be able to refresh a child window that was opened before from that page using a named target:

<a href="new_window.php" target="my_new_window_i'm_going_to_refresh">

(apostrphe for demonstration purposes only :) repeated clicking on that link should refresh the child every time. It doesn't work the other way round, though.

Pekka
A: 

In parent expect the refreshed values something like as:

parent.php?value=xxx

on popup, when user clicks close, you can always use window.opener.location = "parent.php?value=XXX" ... this will refresh the parent with the value selected.

effkay