Forum Moderators: coopster

Message Too Old, No Replies

odd problem- ghost text

         

disgust

9:16 am on Nov 27, 2004 (gmt 0)

10+ Year Member



I originally had a file, adsense.php, send one of a few different ads depending on a cookie that's read earlier... here's the original code:

<?
// ad #1

$ad1 = '<script type="text/javascript"><!--
google_ad_client = "pub-#*$!xxxxxxx";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="6639679453";
google_ad_type = "text";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "003333";
google_color_url = "000000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>';

// ad #2

$ad2 = '<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxx";
google_ad_width = 250;
google_ad_height = 250;
google_ad_format = "250x250_as";
google_ad_channel ="6639679453";
google_ad_type = "text_image";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "003333";
google_color_url = "000000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>';

// test cookie, echo ad

if ($cookset == 1)
{
echo $ad1.php;
}
else
{
echo $ad2.php;
}

?>

it works just fine, but after the adsense ad, it displays "php." just "php," right after the code. if I edit adsense.php to just be one adsense ad, it's fine.

what's going on here?

[edited by: jatar_k at 7:30 pm (utc) on Nov. 27, 2004]
[edit reason] generalized [/edit]

Crustov

11:51 am on Nov 27, 2004 (gmt 0)

10+ Year Member



>> echo $ad1.php;

What's the point of the ".php"?

why don't you:

echo $ad1;

a "." the concat operater, so it is concatting your ad and the string "php"

disgust

12:15 pm on Nov 27, 2004 (gmt 0)

10+ Year Member



haha, knew it must've been something simple... thanks