Does Php Code Inside An Iframe Work With Php Outside Of This Iframe?

Discussion in 'PHP' started by joliett89, Feb 14, 2013.

  1. #1
    I have a wordpress blog, with an iframe included in sidebar.php. I have some wordpress specific code inside of this iframe, and it does not seem to "interact" with the rest of the wordpress code. Is it normal? Is there any way to get around this one?

    <ul><li><a href="http://www.domain.com/" target="_blank">domain.com</a></li><?php $blog_title = esc_attr( get_bloginfo( 'name', 'display' ) );$words = split(' ', $blog_title);$actor_name = ucwords($words[0] . ' ' . $words[1]); ?><li><a href="http://www.name.com/pictures/<?=str_replace(' ', '+', $actor_name)?>" target="_blank"><?=$actor_name?> Model Search</a></li></ul>


    Thank you.
     
    joliett89, Feb 14, 2013 IP
  2. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #2
    I get what your saying... but I/we don't know what the problem is?
    For one I wouldn't display it as an iFrame

    Show us the full code from <iframe that your using and someone will post an alternative script.
     
    MyVodaFone, Feb 14, 2013 IP
  3. gavo

    gavo Active Member

    Messages:
    123
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    70
    #3
    Does this help?

    Change target="_blank"> to target="_top">

    Then when a link is clicked inside the iframe it will break the frame
     
    gavo, Feb 14, 2013 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    My thoughts on that too.... this is 2013 not 1997, you shouldn't be using iframe, target, etc, etc... PARTICULARLY if you want something inside said 'frame' to 'break out' of it.
     
    deathshadow, Feb 14, 2013 IP