2011-05-29 76 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」。

相關問題