Web Hosting Talk







View Full Version : GoogleAds into CGI Scripts


mkg1
03-31-2005, 06:47 AM
I am trying to insert my googleads code into a .cgi script. But each time I do, I get an internal server error. The error log says: "Premature end of script headers"

I have tried the normal google ads code, and also the code formatted like:

$content = "<script type=\"text/javascript\"><!--
google_ad_client = \"pub-xxxxxxxxxxxxxxxxxxx\";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = \"728x90_as\";
google_ad_channel =\"xxxxxxxxxxx\";
google_ad_type = \"text_image\";
google_color_border = \"333333\";
google_color_bg = \"000000\";
google_color_link = \"ffffff\";
google_color_url = \"999999\";
google_color_text = \"cccccc\";
//--></script>
<script type=\"text/javascript\"
src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script>";

Anyone that knows how to do it?

Cheers

funzie
04-01-2005, 03:49 PM
try
$content = qq~<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxxxxxx";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="xxxxxxxxxxx";
google_ad_type = "text_image";
google_color_border = "333333";
google_color_bg = "000000";
google_color_link = "ffffff";
google_color_url = "999999";
google_color_text = "cccccc";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>~;