1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Open in the same windows Ifame

Discussion in 'General PHP and MySQL Discussions' started by Wuebit, May 27, 2011.

  1. Wuebit

    Wuebit Well-Known Member

    I have this php file which pulls from my datebase

    PHP:
    <?php
    $cdb 
    = new PDO('mysql:dbname=xxx;host=localhost''xxx''xxx');

    foreach (
    $cdb->query("SELECT * FROM images ORDER BY posted DESC LIMIT 3") AS $img)

    {
    $twofirst substr($img['hash'], 02);
        echo 
    '
                    <a style="position: relative; display: block; height: 140px;" href="/booru/post/view/' 
    $img['id'] . '" target="_blank">

                        <img src="booru/timthumb.php?src=images/' 
    $twofirst '/' $img['hash'] . '&h=125&w=125&q=100" width="125px" style="border-style: none"/>
                    </a>
                    '
    ;

    }
    And in the xenforo template is as follows

    HTML:
      <div class="section">
        <div class="secondaryContent">
                <h3>New Cosplays</h3>
                  <iframe marginwidth="0" marginheight="0" width="125px" height="400px" scrolling="no" frameborder=0 src="image.php">
                  </iframe>
       </div>
     </div>
    Is there a better way I can get this to work?
    If I don't add the
    PHP:
    target="_blank"
    It just opens the page in the Iframe which is 100% fail

    Thanks for your time.
     
  2. James

    James Well-Known Member

    Have you considered using AJAX to pull it into the current page?
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    I think he wants it to open in a new tab/page, but without using target=blank.
     
  4. Wuebit

    Wuebit Well-Known Member

    nono :p quite from that I want it to open in the same windows without using an Iframe :)

    Hmm can this be done? my AJAX is Zero
     
  5. James

    James Well-Known Member

  6. Wuebit

    Wuebit Well-Known Member

    Hmm I'll give it ago. But is that not for loading overlays and "click to show AJAX" am after it been loaded all the time without click but I guess some of the code could be changed

    Cheers

    Doh there is more than one video I'll watch the rest my bad..
     
  7. James

    James Well-Known Member

    The second video shows how to load another page into the current page using the ContentLoader class.
     
  8. Wuebit

    Wuebit Well-Known Member

    Does it? Where? Don't think I understand this tbh this might be over my head..
     
  9. James

    James Well-Known Member

    Oops, my bad. It's the first video about 8 minutes in.
     
    Vodkaholic likes this.
  10. Wuebit

    Wuebit Well-Known Member

    Meh I don't get it at all AJAX makes my head hurt..
    Thanks tho James I'll stick with the Iframe for now..
     
  11. Wuebit

    Wuebit Well-Known Member

    Just a small update if anyone else the same problem, I asked on stackoverflow and someone said to change the _blank to _top and it works :) woot

    Cheers
     

Share This Page