This script works fine, unless the included file contains javascript, then it breaks with the "unterminated string" literal error. Removing spaces and linebreaks does not cure the problem.
<script type="text/javascript">
var myArray = [
'url',
'url2',
'url3',
'url4',
'url5',
];
var i, numDomains = myArray.length, found = false;
for (i = 0; i < numDomains; i++) {
if (document.referrer.indexOf(myArray[i]) > -1) {
found = true;
}
}
document.write((found ? '<?php include("file1.php"); ?>' : '<?php include("file2.php"); ?>'));
</script>
A good solution would be where the included file can be any normal html file.
This is the output of the offending file:
<!-- google_ad_client = "pub-0705348955426556";/* ORG 468x60 */ google_ad_slot = "2106718798";google_ad_width = 468;google_ad_height = 60;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><script src="http://googleads.g.doubleclick.net/pagead/test_domain.js"></scri