Re: Reloading a specific window

From: Date: Thu, 02 Oct 2003 15:50:54 +0000
Subject: Re: Reloading a specific window
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-164773@lists.php.net to get a copy of this message
Output from action.php: <script> opener.location.reload(); close(); </script> Rich Fox wrote:
Warning for server side purists: My php scripts use javascript to popup and close windows. So this question, although posted to a php newsgroup, has elements of javascript too. Gasp! No flames please. I have a main window which I will refer to as mainwindow (window.name='mainwindow' in the onload event). The script loaded into it is mainListing.php. From mainListing.php I popup another window, with a form and a save button. The form's action is "action.php" In action.php I update the database and then would like to: (1) refresh mainwindow so it reflects the database changes, and (2) close the popup window. I have been reading, tweaking, trying different things but nothing is working. Currently, the action script does: ... elseif (isset($_POST['btnSave'])) { .. update the database, then ...
    header("Location: ".$_POST['CallingScript']."?ID=".$_POST['ID']);
    exit;
} ... This reloads the popup window, and then I have a "close" button to close the popup. Then I have to refresh the browser window manually to see the updated table from the database. Can I get some advice on how to accomplish (1) and (2) above? Many thanks, Rich


« previous php.general (#164773) next »