logged_with_bugmenot Posted July 8, 2006 Share Posted July 8, 2006 I need a code that will grab the parent URL of a popup. Does anyone know of one? Link to comment https://forums.phpfreaks.com/topic/13997-is-there-a-code-that-grabs-the-url-of-a-parent-window-of-a-popup/ Share on other sites More sharing options...
Travis Estill Posted July 8, 2006 Share Posted July 8, 2006 You could append the parent URL to the query string in JavaScript:[code]<?php $parent = "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];?>window.open("http://www.example.com/?parent=<?php echo urlencode($parent); ?>","mywindow");[/code]Then, on the popup page, grab that GET variable like this:[code]<?php$parent = urldecode($_GET['parent']);?>[/code] Link to comment https://forums.phpfreaks.com/topic/13997-is-there-a-code-that-grabs-the-url-of-a-parent-window-of-a-popup/#findComment-54680 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.