php pencereler arasında ilanı değişkenlerin

2 Cevap

benim başlık açık olmayabilir. Ama temelde ne yapmak istiyorum:

Benim php biçiminde bir bağlantı olacak

<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?

Çevre: PHP

Herkes bana bir fikir verebilir misiniz?

2 Cevap

Ebeveyn gibi gibi tazelenmiş değerler şey bekliyoruz:

parent.php? değeri = xxx

kullanıcı yakın tıkladığında açılır pencerede, her zaman window.opener.location = "parent.php? değeri = XXX" ... Bu seçilen değeri ile üst yenilenir kullanabilirsiniz.

Bildiğim kadarıyla PHP (veya, daha doğrusu, saf HTML) kullanarak bir üst pencere yenileme olamaz. Sen onLoad olayı Javascript biraz gerekir:

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

Bir child window adlı bir hedef kullanarak bu sayfadan önce açılmış yenilemek mümkün olacaktır:

<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.