<?php
$frame = $mysqli->query("SELECT * FROM `".$prefix."rekl` WHERE `stat` = '4' ORDER BY RAND() LIMIT 1");
if($frame->num_rows > 0)
{
while($f = $frame->fetch_assoc())
{
?>
<script>
function url_open()
{
window.open("http://<?php echo ''.$f['link'].''; ?>");
}
</script>
<?
}
}
?>