Jump to content

Change parent URL from child


cmattoon

Recommended Posts

I know this has to be a really simple function, but it's totally escaping me today.

 

I want to open a child window, find a result then change the parent's URL to the previous URL, plus a ?result=

 

Example:

 

parent.php is accessed (URL: "parent.php?foo=bar"). User clicks a link, which opens up a new window, and refreshes the parent window to: "parent.php?foo=bar&result=myresult"

 

(parent.php can be accessed by a couple pages, where RESULT would be filled out, but if it's accessed alone, it needs to have the result paramater selected)

 

Thanks!

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/204874-change-parent-url-from-child/
Share on other sites

It sounds like what you are looking for is actually AJAX. Instead of opening a new window to return a result, you could send the request via a XMLHttpRequest object and change the location based on the result. Is there a specific reason that it needs to be in a new window? Maybe you could show some code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.