NYCPHP Meetup

NYPHP.org

[nycphp-talk] More Client-Side Grief

Adam Fields fields at surgam.net
Tue Oct 29 10:38:02 EST 2002


On Tue, Oct 29, 2002 at 09:59:29AM -0500, Hans Zaunere wrote:
> This isn't so much a problem with PHP, but I hope someone can help out
> with some JavaScript issues I'm having.
>
> With IE6 (this app only needs to support IE6) I have Window 1 (main
> browser window) and Window 2 (popup).  The user enters some information
> into the popup and submits the form, which PHP then processes and sends
> a header('Location: http://somewhere/whatever'); back to the popup.
> 
> The problem is, I need to get the parent window (Window 1) to be
> redirected, while the popup (Window 2) closes.  Any ideas on how to
> either:
> 
> 1) Have the popup send it's new location (from the PHP form processor)
> back to it's parent.
> 
> 2) Or, have the parent see where the popup would be redirected to, and
> redirect itself?
> 
> 3) Or something else.

I use this for reloading the base window and closing the popup. I
can't think of any reason why you couldn't use something similar to
redirect the base window to another url.

Basically, I have a generic save page that detects if it was called as
a popup (right now, I pass this value in, but I should probably
ultimately be getting it from the browser). If not, it reloads itself
to some other appropriate url (I'm working on a system for carrying a
stack of jumpback urls through a window thread - it's not quite there
yet). If yes, then it does this:

  print '<script language="javascript">';
  print 'opener.location.reload();';
  print 'self.close();';
  print '</script>';

Or were you looking for something else?

-- 
				- Adam

-----
Adam Fields, Managing Partner, fields at surgam.net
Surgam, Inc. is a technology consulting firm with strong background in
delivering scalable and robust enterprise web and IT applications.
http://www.adamfields.com



More information about the talk mailing list