当前位置: 代码迷 >> PHP >> php输出html有关问题,
  详细解决方案

php输出html有关问题,

热度:299   发布时间:2016-04-29 01:32:58.0
php输出html问题,!急
如何把php输出的html代码加入到网页中并显示,php输出的代码是一个广告页面!

这个是showads.php

PHP code
<?phpecho <<<eof<p>    <script type="text/javascript">    google_ad_client = "pub-3381531532877742";    google_ad_slot = "7423315034";    google_ad_width = 728;    google_ad_height = 90;    </script>    <script type="text/javascript"    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">    </script>      </p>      <p>        <script type="text/javascript">    google_ad_client = "pub-3381531532877742";    google_ad_slot = "7423315034";    google_ad_width = 728;    google_ad_height = 90;        </script>    <script type="text/javascript"    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">    </script>    </p>eof;?>



如何把这个加到index.html里显示,不能用iframe

谢谢!

------解决方案--------------------
把3楼的代码存为一个文本文件,例如文件名ggads
然后在需要用到的地方<?php include("ggads") ?>
当然还要保证文件名前路径正确
  相关解决方案