FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Google Adsense With Php

 


smokey4life
Ok i dont knnow if im just tired or what but i cant get this damn adsenses code to parse correctly in my php script heres what im using
Code:
echo "<script type=\"text/javascript\"><!--\n";
echo "google_ad_client = \"pub-0602418212667318\";\n"
echo "google_ad_width = 728;\n";
echo "google_ad_height = 90;\n";
echo "google_ad_format = \"728x90_as\";\n";
echo "google_ad_type = \"text_image\";\n";
echo "google_ad_channel =\"5145829577\";\n";
echo "google_color_border = \"000000\";\n";
echo "google_color_bg = \"666666\";\n";
echo "google_color_link = \"00FF00\";\n";
echo "google_color_url = \"FF0000\";\n";
echo "google_color_text = \"FFFFFF\";\n";
echo "//--></script>\n";
echo "<script type=\"text/javascript\"\n";
echo "src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">\n";
echo "</script>\n";
now why the hell isnt that working? I prolly shouldnt be doing this stuff when i havent had much sleep but i need to get it working lol Anyone see anything wrong? I keep getting this parse error
Code:

Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in /home/smokey4l/domains/runesource.frih.net/public_html/games/includes/common_funcs.inc.php on line 26
n0obie4life
Code:
echo "google_ad_client = \"pub-0602418212667318\";\n"


Replace with

Code:
echo "google_ad_client = \"pub-0602418212667318\";\n";


You forgot the ";" at the end of it.
smokey4life
Og My GOD! I cant belive i made the most commonly seen mistake and didnt even notice it Smile lol sorry for waisting your time and thanks for your help, see another perfect reason to be a member of these forums Wink And yeah that was deffinately it Smile works fine now
sonam
Hi,
I have one more sugestion. When I using adsence I am copy/paste original code in plain txt file and then include txt file on pages. It is working good and google count properly all visits or clicks. Very Happy

Sonam
AftershockVibe
For other people who might want do this...

The easiest way is just to dump it all in a file and then use include() then you don't need to mess around with escape characters and quote marks.

Cool
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.