My server is set to parse HTML documents as PHP and it works fine. However, with this particular code it seems to be not working.
<div class="container">
<div class="pb-4">
<?php
$referrer = $_SERVER['HTTP_REFERER'];
$my_domain = "example.com";
$search_engines = "google|yahoo|bing|altavista|digg";
$pattern = "((http(s)?:\/\/)(\w+?\.)?(?!{$my_domain})({$search_engines}))";
if (preg_match("/{$pattern}/i", $referrer) != false) {
echo <<<END
<script type="text/javascript"><!--
google_ad_client = "xx-xx-xxxxxxxxxxxxxxxxxx";
/* xxxxxxxx xxxxxx xxx xxx xxx xx xxxxxx */
google_ad_slot = "xxxxxxxxxxxxxx";
google_ad_width = xxx;
google_ad_height = xxx;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
END;
} else {
}
?>
</div>
</div>
When I insert that PHP part and open the page it just displays the END; } else { } ?> on front-end. Any help you can provide with this would be greatly appreciated.