query("SELECT ipb_id from archived_vb_import_log WHERE (type = 'topics' AND foreign_id = '" . $t . "')"); while($row = mysqli_fetch_assoc($result)) { $id = $row['ipb_id']; } if ($id > 0) { header('Location: http://www.portaldasviagens.com/threads/' . $id . ''); } else { header('Location: http://www.portaldasviagens.com/'); } ?>