Re: Header() to a different browser instance
| From: | chris at etranz dot com dot au | Date: | Mon, 10 Jul 2000 05:54:58 +0000 |
| Subject: | Re: Header() to a different browser instance | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5686@lists.php.net to get a copy of this message | ||
I'd probably walk the form and attach it as a query string to the url.
This has not been tested.
function closeandredirect() {
url="add_property.php?";
formels=document.forms[0].elements;
numel=formels.length;
for (x=0;x<numel;x++){
url+=escape(formels[x].name)+"="
+((formels[x].selectedIndex!=null)?
escape(formels[x].options[formels[x].selectedIndex].value)
:escape(formels[x].value))+((x==(numel-1))?"":"&");
}
self.opener.location.href=url;
self.close();
}
----- 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
>
>