I dont understand php all that much

scylla

Member
Messages
232
Reaction score
0
Points
16
so I have a question about this... How do I insert my adsense code properly in this file?

With the way it is right now, it says
"Parse error: syntax error, unexpected T_STRING in /home/content/a/v/a/avalanch/html/playstation-3/config.php on line 11"

PHP:
<?php
$title = "Playstation Hub"; 
// Title of your website

$keyword = "playstation+3"; 
// The keyword that your content will be based on
// For keywords with two or more words, use "+" instead of space
// i.e. "new+york+travel"

$ads = "<google>
<script type="text/javascript"><!--
google_ad_client = "pub-6991322522351721";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "CCCCCC";
google_color_bg = "CCCCCC";
google_color_link = "0000FF";
google_color_url = "0000FF";
google_color_text = "0000FF";
//--></script>
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script>
</google>";
// Your ads which will be displayed on the pages

$text_color = "black"; 
// The color of text which is displayed

$table_fill = "#2375A4"; 
// The table fill color

$menu_color = "#95CC02"; 
// The menu color
?>
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
The google tag is not avaialable on html So i think the tag google has to be removed.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
PHP:
<?php
 
 
$ads = '<google>
<script type="text/javascript"><!--
google_ad_client = "pub-6991322522351721";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "CCCCCC";
google_color_bg = "CCCCCC";
google_color_link = "0000FF";
google_color_url = "0000FF";
google_color_text = "0000FF";
//--></script>
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script>
</google>';
 
?>

Use single quotes around the string you are using (since you are using double quotes inside the string).
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Read up on string syntax in PHP for more info. Note also the coloration of your code in your post, how it switches between red (within a string) and blue (not in a string), and compare it to Descalzo's (all red).
 
Last edited:
Top