下面是我的AdCode,我只是尝试将URI传递给chnm =代码上的脚本标记之一。
我不知道做这件事的最好办法是什么。
<?php
if( aicp_can_see_ads() ) { // This part will show ads to your non- banned visitors
$channel = $_SERVER['REQUEST_URI'];
$adCode = '<div class="aicp"><!-- Don\'t forget to add this div with
aicp class -->
<script id="mNCC" language="javascript">
width = "950";
height = "900";
crid = "65743925";
versionId = "09428435";
chnm = "<?php echo $channel ?>"; //Used to specify the channel name
</script>
<script src="//adserver.net/ads.js"></script> </div><!-- end of the
aicp div -->';
echo $adCode;
}
?>基本上,我只需要能够通过chnm = tag将标记代码动态显示的URI或URL路径传递给adserver。
发布于 2019-02-06 17:05:43
只需使用纯javascript:
chnm = window.location.href;但是为了让你的例子起作用,你需要清理大量的代码。
https://stackoverflow.com/questions/54558805
复制相似问题