2011-05-29 64 views
0

我有这个PHP文件从我DATEBASE打开在同一窗口(PHP文件),比一个I帧

<?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'], 0, 2); 
     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> 
        '; 

    } 

模板

<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> 

拉等是否有更好的方法可以让我得到这个上班? 如果我不添加target="_blank"它只是打开在于iframe页面这不是我想要的

有人说使用AJAX,但我不知道该怎样甚至开始的想法,如果有人也许可以告诉我一个例子那太好了。

感谢您的时间。

+0

我想有一些其他的目标可以用来获得这种效果。不记得它到底是什么,但尝试使用“_top”或“_parent”。 – Alxandr 2011-05-29 15:11:48

+0

哈真棒你的权利_top作品非常感谢:D – VK27 2011-05-29 15:13:50

+0

我会添加,作为答案,所以你可以接受。 – Alxandr 2011-05-29 15:16:20

回答

1

使用target =“_ top”而不是“_blank”。

相关问题