I have this php file which pulls from my datebase
<?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>
';
}
Template
<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 target="_blank" It just opens the page in the Iframe which is not what I want
Someone say to use AJAX but I have no idea of how to even start if someone could maybe show me an example that would be great.
Thanks for your time.
Use target=”_top” instead of “_blank”.