Results 1 to 2 of 2

Thread: Opening variable link in iframe on seperate page

  1. #1
    Join Date
    Jan 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Opening variable link in iframe on seperate page

    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:
    1. How do I load the target url on Page A into the iframe on Page B?
    2. 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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Just do a GET. Like on pageA.php have a link:

    HTML Code:
    <a href="pageB.php?iframe=somepage.php">Some Page</a>
    On pageB.php have an iframe:

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

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •