Log in

View Full Version : Opening variable link in iframe on seperate page



danielmeade
12-05-2011, 01:41 AM
First off I want to say that this may not be posted in the correct section, but as I'm using wordpress and need to fetch a variable URL I figured this might be the best place to go.

What I'd like to do is open a link (which is variable) on page A, into an iframe on page B.

I have two problems:
How do I load the target url on Page A into the iframe on Page B?
How do I fetch the url (which varies) and pass that throught to the iframe?


The url will vary using the custom posts feature within Wordpress.

I'd really appreciate any input on this one! Thanks :)

jscheuer1
12-05-2011, 03:51 AM
Just do a GET. Like on pageA.php have a link:


<a href="pageB.php?iframe=somepage.php">Some Page</a>

On pageB.php have an iframe:


<iframe src="<?php echo isset($_GET['iframe'])? $_GET['iframe'] : 'somedefault.php'; ?>" width=300 height=200></iframe>