我只想在访客来自推特时显示我的谷歌Adsense广告。目前我正在使用这段代码,这对Facebook和其他网站有效,但对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 ""; }
?>