ผู้ที่มีความรู้ทาง php ช่วยหน่อยครับ

พอดีผมจะลง โฆษณา ที่หัวกระทู้ของ IPB แต่แก้ไม่เป็น

นี้โคดเก่า

//-----------------------------------------
// Format and print out the topic list
//-----------------------------------------

while ( $row = $this->ipsclass->DB->fetch_row( $oq ) )
{
$return = $this->lib->parse_row( $row );

$poster = $return[‘poster’];


อันนี้ทำตามที่เว็บเค้าสอนเอา AdSense ไปใส่ เว็บปกติครับ AdSense ก็ขึ้น

//-----------------------------------------
// Format and print out the topic list
//-----------------------------------------
//Replace the text below with your AdSense code
$adsense=’<script type=“text/javascript”><!–
google_ad_client = “pub-xxxxxxxxxxxxxxx”;
google_ad_slot = “xxxxxxxxx”;
google_ad_width = 728;
google_ad_height = 90;
</script>
<script type="text/javascript"
src=“http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>
’;
$a=1;
while ( $row = $this->ipsclass->DB->fetch_row( $oq ) )
{
$return = $this->lib->parse_row( $row );

if($a == 1){
$return[‘row’][‘post’]=$adsense. $return[‘row’][‘post’];
}
$a++;

$poster = $return[‘poster’];
$row = $return[‘row’];
$row = $return[‘row’];

แต่ๆๆ โฆษณาตัวนี้เวลาจะให้มันขึ้นผมจะต้องทำแบบนี้

<?
include(‘adrotate.php’);
?>

ผมจะเอา

<?
include(‘adrotate.php’);
?>
[b]
ไปแทน AdSense ยังไงคับ ช่วยหน่อยนะครับ

ขอบคุณมากครับ[/b]

ถ้า $adsense=include(‘adrotate.php’)

เลยได้ป่ะครับ ผมไม่มีความรู้ทางนี้เลย

ยังไม่ค่อยเข้าใจคำถามเท่าไรนักนะครับ แต่เข้าใจว่า ตัว โฆษณาที่จะเอามาใช้ เป็น ตัว rotate ที่เขียนขึ้นอีกไฟล์หนึ่ง แล้วต้องการเอามา ใส่เข้าในอีกไฟล์ที่คุณแสดง code ออกมา และใน code ที่แสดง $adsense =… ตัวนี้ถูกนำไปแสดงในภายหลัง
จริงๆจะต้องดูว่า code ตัว adrotate ที่จะ include เข้ามานั้นมีเนื้อหาเป็นอย่างไร แต่เดาว่าคง echo ข้อความออกมาจากไฟล์ adrotate.php เลย

อย่างในกรณีนี้ ผมแก้ให้ตามความเข้าใจคำถามนะครับ

//-----------------------------------------
// Format and print out the topic list
//-----------------------------------------
//Replace the text below with your AdSense code

/* <—คอมเมนออกไปเลย

$adsense=’<script type=“text/javascript”><!–
google_ad_client = “pub-xxxxxxxxxxxxxxx”;
google_ad_slot = “xxxxxxxxx”;
google_ad_width = 728;
google_ad_height = 90;