Php 仅显示谷歌AdSense广告的Twitter访问者
我只想在访客来自Twitter时显示我的Google Adsense广告。目前我正在使用这段代码,这对Facebook和其他网站有效,但对Twitter无效Php 仅显示谷歌AdSense广告的Twitter访问者,php,twitter,preg-match,strpos,http-referer,Php,Twitter,Preg Match,Strpos,Http Referer,我只想在访客来自Twitter时显示我的Google Adsense广告。目前我正在使用这段代码,这对Facebook和其他网站有效,但对Twitter无效 <?php $ref = $_SERVER['HTTP_REFERER']; if (strpos($ref, 'twitter.com') != false) {?> <script type="text/javascript"><!-- go
<?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 ""; }
?>
Twitter通过
寻找t.co推荐人请不要破坏您的帖子。一旦您发布了一个问题,您就已经根据CC by SA许可证将内容授权给了Stack Overflow社区。如果您想解除此帖子与您帐户的关联,请参阅。