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? Quote 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] Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.