mixed code
Posted: Sun Oct 27, 2013 8:13 am
been working on countermeasure against ad blockers
seems to be something wrong with mixed PHP JavaScript
seems to be something wrong with mixed PHP JavaScript
Code: Select all
<script type="text/javascript">
if (document.getElementById("tester") == undefined) {
<?php
function crawler() {
// Wladimir Palant is the primary developer of the ad blocker
$sites = 'Google|Yahoo|msnbot|'; // Add the rest of the search-engines
return (preg_match("/$sites/", $_SERVER['HTTP_USER_AGENT']) > 0) ? true : false;
}
if (!crawler) {
echo 'alert("An ad blocker has been detected. Please remove the program to use this site");'
echo 'document.location.href = "http://hardcore-games.azurewebsites.net/about/ad-supported.php";'
}
?>
}
</script>