A friend of mine wanted me to gather some statistics for his website so I gave him the following code to insert in his page footers:
<div>
<script>
var wandTopSitesUserId;
match = document.cookie.match(new RegExp("WandTopWildlifeSites" + '=([^;]+)'));
if (match)
wandTopSitesUserId = match[1];
else {
wandTopSitesUserId = (+new Date * Math.random()).toString(36).slice(2, 12);
document.cookie = 'WandTopWildlifeSites=' + wandTopSitesUserId + '; expires=Tue, 1 Jan 2030 00:00:00 UTC; path=/';
}
document.write('<div style="visibility: hidden;"><a href="http://www.www.fxxxxx.com/"><img src="http://xxxxxx.azurewebsites.net/Log/LogVisit/?siteId=2&userId=' + wandTopSitesUserId + '&pageName=' + location.pathname + '" alt="WAND Top Wildlife Sites" /></a></div>');
</script>
</div>
What I didn't know is that he's using PHP and I know absolutely nothing about PHP. When he attempts to insert my code into his PHP script, he gets the following error:
string(125) "Smarty error: [in globalcontent:footer line 9]: [plugin] unknown tag - 'wandTopSitesUserId' (core.load_plugins.php, line 198)" string(137) "Smarty error: [in globalcontent:footer line 9]: syntax error: unrecognized tag 'wandTopSitesUserId' (Smarty_Compiler.class.php, line 590)"
Not knowing anything about PHP, I have idea how to fix this.