Re: [Fwd: Re: [PHP] Header() to a different browser instance]

From: Date: Mon, 10 Jul 2000 05:15:28 +0000
Subject: Re: [Fwd: Re: [PHP] Header() to a different browser instance]
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-5678@lists.php.net to get a copy of this message
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 > -------- Original Message -------- > Subject: Re: [PHP] Header() to a different browser instance > Date: Mon, 10 Jul 2000 19:27:45 +0200 > From: dgw@q-logic.org > To: <php-general@lists.php.net> > > Hi, > > Ive been testing a bit and theres no PHP involved, its all javascript, > but > here goes anyway. The trick is in the self.opener which references the > window that opened the popup. > > Lets say we have a file called one.html that opens a popup. It could > look > like this: > <SCRIPT LANGUAGE="javascript"> > function popup() { > window.open( "pop.html", "", "width=100,height=100" ); > } > </SCRIPT> > <A HREF="javascript:popup()">Click here to continue</A> > > The pop.html would be something like: > <SCRIPT LANGUAGE="javascript"> > function closeme() { > self.opener.location.href="two.html"; > self.close(); > } > </SCRIPT> > <A HREF="javascript:closeme()">Close me</A> > > This will close itself and redirect the opener to the page two.html. > > Hope it helps > > David Garcia Watkins > > ----- Original Message ----- > > > > > Hello List, > > > > > > I've got some javascript that pops up a new browser window. From within > > > that browser I call a php script that does some sql, and then does a > > > Header redirect back to the original page (browser instance). > > > > > > However, with the Header() redirect my original page just gets created > > > inside the second instance popped-up browser. > > > > > > Alternatively, the following just closes the window, and the php script > > > is never called from the form. > > > > > > <input type="submit" name="Submit" > > > value="Add"onClick="closeWindow()"> > > > > > > Can anyone share with me whether it is possible to do what I want to do > > > (essentially close a popped up browser and redirecting the original > > > browser instance), and give some advice on how to do it.

« previous php.general (#5678) next »