This page receives the link from the control panel and opens this link inside an iframe, but there are sites that do not work with this system. I want to write a code that checks whether the site will work on an iframe. If yes, it does nothing. If it does not, it opens the link in a new window.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><?= $ads['name'] ?> | <?= $settings['name'] ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="<?= $settings['description'] ?>" name="description" />
<meta content="Vie Faucet Script" name="author" />
<!-- App favicon -->
<link rel="shortcut icon" href="<?= base_url() ?>assets/images/favicon.ico">
<!-- Bootstrap Css -->
<?php if ($settings['theme'] == 'light') {
echo '<link href="' . base_url() . 'assets/css/bootstrap.min.css?v=' . VIE_VERSION . '" id="bootstrap-style" rel="stylesheet" type="text/css" />';
echo '<link href="' . base_url() . 'assets/css/app.min.css?v=' . VIE_VERSION . '" id="bootstrap-style" rel="stylesheet" type="text/css" />';
} else {
echo '<link href="' . base_url() . 'assets/css/bootstrap-dark.min.css?v=' . VIE_VERSION . '" id="bootstrap-style" rel="stylesheet" type="text/css" />';
echo '<link href="' . base_url() . 'assets/css/app-dark.min.css?v=' . VIE_VERSION . '" id="bootstrap-style" rel="stylesheet" type="text/css" />';
}
?>
<!-- Icons Css -->
<link href="<?= base_url() ?>assets/css/icons.min.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url() ?>assets/css/styles.css" rel="stylesheet" type="text/css" />
<style>
.fixed-banner {
position: fixed;
bottom: 10px; /* مسافة الإعلان عن أسفل الشاشة */
left: 50%;
transform: translateX(-50%);
z-index: 9999;
background-color: #fff; /* خلفية الإعلان */
border: 1px solid #ccc; /* إطار */
padding: 10px;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
text-align: center;
}
.fixed-banner img {
max-width: 100%;
height: auto;
}
</style>
</head>
<body data-sidebar="dark" style="overflow: hidden">
<div class="container-fluid ptc-header">
<div class="row">
<div class="col-md-6">
<a class="btn btn-success" href="<?= base_url() ?>">Back to home</a>
</div>
<div class="col-md-6">
<span class="font-size-15 text-truncate text-white" id="ptcCountdown">Please wait...</span>
</div>
</div>
</div>
<iframe id="ads" src="<?= $ads['url'] ?>" frameborder="0" style="width: 100%; height: calc(100vh - 75px);" sandbox="allow-same-origin allow-scripts allow-forms"></iframe>
<!-- إعلان ثابت -->
<div class="fixed-banner">
<script type="text/javascript">
atOptions = {
'key' : '178694d86380d0eaf640c52262adfb82',
'format' : 'iframe',
'height' : 90,
'width' : 728,
'params' : {}
};
</script>
<script type="text/javascript" src="//cuckoosad.com/178694d86380d0eaf640c52262adfb82/invoke.js"></script>
</div>
<div class="modal fade" id="ptcCaptcha" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Complete the captcha to get reward</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<!-- مكان الإعلان -->
<div class="captcha-ad" style="text-align: center; margin-bottom: 20px;">
<script type="text/javascript">
atOptions = {
'key' : '9850e3b059dd16c8a1a2a1e45f58eaa6',
'format' : 'iframe',
'height' : 60,
'width' : 468,
'params' : {}
};
</script>
<script type="text/javascript" src="//cuckoosad.com/9850e3b059dd16c8a1a2a1e45f58eaa6/invoke.js"></script>
</div>
<form action="<?= site_url('/ptc/verify/' . $ads['id']) ?>" method="POST">
<center>
<?= $captcha_display ?>
</center>
<input type="hidden" name="<?= $csrf_name ?>" value="<?= $csrf_hash ?>">
<button id="verify" class="btn btn-success btn-block" type="submit">Verify</button>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var timer = <?= $ads['timer'] ?>;
var url = '<?= $ads['url'] ?>';
</script>
<script src="<?= base_url() ?>assets/libs/jquery/jquery.min.js"></script>
<script src="<?= base_url() ?>assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="<?= base_url() ?>assets/libs/node-waves/waves.min.js"></script>
<!-- App js -->
<script src="<?= base_url() ?>assets/js/app.js"></script>
<script src="<?= base_url() ?>assets/js/vie/captcha.js"></script>
<script src="<?= base_url() ?>assets/js/vie/ptc.js"></script>
<?php if (isset($_COOKIE['captcha'])) { ?>
<script>
$('option[value=<?= $_COOKIE['captcha'] ?>]').attr('selected', 'selected');
</script>
<?php } ?>
<?php
if (isset($_SESSION['sweet_message'])) {
echo $_SESSION['sweet_message'];
}
?>
<?= $settings['footer_code'] ?>
<?php include 'adblock.php'; ?>
</body>
</html>
I tried more than once with GPT chat and more than one artificial intelligence model, but this problem was not solved. I am not a programmer. I purchased the script and the programmer does not want to respond.
enter image description here
ِAli Shrif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3