Jump to content

Recommended Posts

Hi guys. I a nearly 100% certain that this is not possible without heroic coding, but for some reason, I have been sucked into the forums to ask the question, once and for all...

 

Is this possible:

 

An address, which goes to a web-page, then redirects an iframe within the specified page?

 

e.g.

 

http://example.com/mypage.php?iframe=http://example.com/mypage.html

 

Or something similar?

 

I am using Joomla v1.5.7, using PHPv5 and SQL(i)

These are nothing to do with it, true, but anyways... ::)

 

Thanks in advance for any help anyone can give.

Link to comment
https://forums.phpfreaks.com/topic/129322-iframe-redirect/
Share on other sites

I think I know what you mean... but I may be oversimplifying the question

 

<iframe src="<?php echo $_GET['iframe']; ?>" height="500">You don't support iframes, bro!</iframe>

 

heck, that's probably not what you want... Can you better explain your problem?

Link to comment
https://forums.phpfreaks.com/topic/129322-iframe-redirect/#findComment-670545
Share on other sites

Hi GenericNumber1. Yes, this is what I meant. I have created my own script that does exactly what yours does, only I have given it a default base-url, so instead of going: xxx.com?=http://xxx.com/page.php i only need to put the page variable "?viewtopic=xxx" and not the whole url.

 

Thanks for your help. What you said would have been great value to me. I appreciate that. ;)

 

Here is what I used. (for similar issues)

 

Where as your script would give me:

http://******/forum?iframe=http://example.com/forum/viewforum.php?f=155

 

Mine gives me:

http://******/forum?get=viewforum.php?f=155

 

My entire page looks like this:

<?php
if (!isset($_GET['target'])) {$target = "/forum-standard/"; } else {$target = $_GET['target'];}
?>  <script language="javascript" type="text/javascript"> function iFrameHeight() { var h = 0; if ( !document.all ) { h = document.getElementById('blockrandom').contentDocument.height; document.getElementById('blockrandom').style.height = h + 60 + 'px'; } else if( document.all ) { h = document.frames('blockrandom').document.body.scrollHeight; document.all.blockrandom.style.height = h + 20 + 'px'; }
}
</script>  <iframe height="500" frameborder="0" width="933" scrolling="no" align="top" onload="iFrameHeight()" id="blockrandom" name="iframe" src="<?php print $target; ?><?php echo $_GET['get']; ?>" class="wrapper">The ColdCast Forums are not available at this time. Sorry.
</iframe>

 

I am sure there will be a more efficient way of doing this, but for now, this will do. My main (and very small) issue is that the page loads fine, but when the iframe changes url, e.g. when a link is clicked, the parent-url stays put, thus giving users the wrong impression if they wanted to send a friend the link.

 

Does anyone know a fix for this?

Link to comment
https://forums.phpfreaks.com/topic/129322-iframe-redirect/#findComment-671155
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.