Jump to content


Photo

header('location: index.php'); parent?


  • Please log in to reply
3 replies to this topic

#1 Hailwood

Hailwood

    Advanced Member

  • Members
  • PipPipPip
  • 51 posts
  • LocationNew Zealand

Posted 11 May 2010 - 11:40 PM

hi there, i have a php script inside an iframe, is it possible to redirect the parent instead of the iframe?

Occupation: Web Developer
www.webspirited.com & www.thirdscreeninteractive.com
HTML, CSS, JS, PHP


#2 Zane

Zane

    Advanced Member

  • Moderators
  • 3,823 posts
  • LocationMurphy, NC

Posted 11 May 2010 - 11:42 PM

not with PHP.. AKA, not with the header() function

You gotta use Javascript..
btn_donate_SM.gif  Want to thank me?  Contribute to my PayPal piggy-bank
 
401299.png

#3 Hailwood

Hailwood

    Advanced Member

  • Members
  • PipPipPip
  • 51 posts
  • LocationNew Zealand

Posted 11 May 2010 - 11:47 PM

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>

Occupation: Web Developer
www.webspirited.com & www.thirdscreeninteractive.com
HTML, CSS, JS, PHP


#4 teamatomic

teamatomic

    Advanced Member

  • Members
  • PipPipPip
  • 1,202 posts
  • LocationBig Sky,MT

Posted 12 May 2010 - 12:13 AM

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
when in doubt...ski fast
when scared...ski faster
when terrified...point em down




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com