0
嗨我想要显示我的Google Adsense广告只有当访问者来自Twitter。目前即时通讯使用的Twitter的代码,这是工作了Facebook和其他人,但它不工作显示Google AdSense广告只有Twitter访问者
<?php
$ref = $_SERVER['HTTP_REFERER'];
if (strpos($ref, 'twitter.com') != false) {?>
<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>
</div>
</div>
<?php }else{
echo ""; }
?>
请不要恶意破坏你的帖子的链接。一旦你发布了一个问题,你已经将内容授权给了Stack Overflow社区(在CC-by-SA许可下)。如果您想取消关联此帐户与您的帐户关联,请参阅[解除请求的正确途径是什么?](http://meta.stackoverflow.com/questions/323395/what-is-the-proper-route-换一个 - 解离 - 请求)。 – Bugs