Re: Header() to a different browser instance
| From: | chris at etranz dot com dot au | Date: | Mon, 10 Jul 2000 06:28:28 +0000 |
| Subject: | Re: Header() to a different browser instance | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5690@lists.php.net to get a copy of this message | ||
Sorry about 2 replys. Something just clicked. Why couldn't you just do something like this:
in current_properties.phtml
<head><title>blah</title>
<script language="javascript">
window.name="parentwindow";
child=open("add_property.phtml","childwindow");
function closechild(){
if (child!=null)
if (child.name=="childwindow")
child.close();
}
</script>
</head>
<body onUnload="closechild()">
in add_property.phtml, get rid of the close and redirect stuff and do this:
<form action="add_property.php" method="post"
target="parentwindow">
...
<input type="submit" name="submit" value="Add">
----- Original Message -----
From: "eric" <edahnke@istreetlabs.com>
To: <php-general@lists.php.net>; <dgw@q-logic.org>; <Boz@musheen.com>
Sent: Monday, July 10, 2000 3:15 PM
Subject: Re: [Fwd: Re: [PHP] Header() to a different browser instance]
>
> Hello,
>
> Thanks a lot for the input. I implemented the example below and it works fine.
> However, what about passing form variables?
>
> The following is how my pages layout.
>
> parent: current_properties.phtml
> child: add_property.phtml
>
> The child calls add_property.php which does the property insertion into the db
> and then Header() redirects back to parent, where the added property is then
> displayed.
>
> Per your help, all the redirects and opening and closing of windows is working
> as I wish. However, my add_property.php script does not receive the form
> variables it needs. That makes sense because the following is how the submit
> is defined, and it does not represent a submission of the form.
>
> Submit: <input type="submit" name="Submit"
> value="Add"onClick="closeandredirect()">
>
> function closeandredirect() {
> self.opener.location.href="add_property.php";
> self.close();
> }
>
> Any ideas on how I can get the vars from the child window, which has a short
> form, to the add_property.php script?
>
>
>
>
> I guess this is JavaScript, and not php, but I could use the help if someone
> knows the answer. Many Thx. - Eric
>
>