Hailwood Posted May 12, 2010 Share Posted May 12, 2010 hi there, i have a php script inside an iframe, is it possible to redirect the parent instead of the iframe? Quote Link to comment https://forums.phpfreaks.com/topic/201461-headerlocation-indexphp-parent/ Share on other sites More sharing options...
Zane Posted May 12, 2010 Share Posted May 12, 2010 not with PHP.. AKA, not with the header() function You gotta use Javascript.. Quote Link to comment https://forums.phpfreaks.com/topic/201461-headerlocation-indexphp-parent/#findComment-1056942 Share on other sites More sharing options...
Hailwood Posted May 12, 2010 Author Share Posted May 12, 2010 damn, well so if i am using jquery could i do something like. <script type="text/javascript"> $(function(){ <?php if(isset($_GET['url'])) { $url = $_GET['url']; echo "parent.location = 'http://'.$url.'";'; } ?> } </script> Quote Link to comment https://forums.phpfreaks.com/topic/201461-headerlocation-indexphp-parent/#findComment-1056944 Share on other sites More sharing options...
teamatomic Posted May 12, 2010 Share Posted May 12, 2010 Do what ever you need to something like this: <script type="text/javascript"> window.location.href = "http://<?php echo $url; ?> target='_top'"; </script> HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/201461-headerlocation-indexphp-parent/#findComment-1056947 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.