Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-27-2004, 04:19 PM
WildSeeker's Avatar
WebProWorld Member
 

Join Date: Nov 2003
Location: New York City
Posts: 32
WildSeeker RepRank 0
Default PHP and AdSense Code

Greetings!

I have been approved by AdSense (Google), and am interested in placing the code on my site pages. I had my developers place it on my index page, and they coded it as a custom footer for the index page. I would like to also place it on select pages on my site, not as a footer necessarily, and would like to do it myself.

I can do relative simple coding on my own, but could use some guidance on placing javascript. What I am hoping for is some guidance on coding tips/examples with respect to the AdSense code and PHP.

Any help here would be greatly appreciated.

Regards,
__________________
Regards,

Tim
WildSeeker
The Adventure Travel Resource
Reply With Quote
  #2 (permalink)  
Old 01-28-2004, 04:37 AM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
cyanide RepRank 0
Default

Hi Wildseeker,

Unfortunately, I'm not familiar with AdSense, yet.
If you are trying to call a Javascript code from a file, you can use this
<script language="javascript" src="somefile.js"></script>
and if it's php
<? include("somefile.php"); ?>
__________________
|
Web Hosting Guru
| Need Help For Your Forum?
Reply With Quote
  #3 (permalink)  
Old 01-28-2004, 02:04 PM
WildSeeker's Avatar
WebProWorld Member
 

Join Date: Nov 2003
Location: New York City
Posts: 32
WildSeeker RepRank 0
Default

Hello Cyanide -

Thanks for your reply. I suppose I should have copied the code here that I am looking to place. Google instructs to "copy-and-paste this HTML code into your web pages":

<script type="text/javascript"><!--
google_ad_client = "my client ID";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

My question is how I place this code into my PHP files. I am familiar with using javascript in HTML pages, just a bit unsure of the intricacies of PHP in this respect.
__________________
Regards,

Tim
WildSeeker
The Adventure Travel Resource
Reply With Quote
  #4 (permalink)  
Old 01-28-2004, 03:25 PM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
cyanide RepRank 0
Default

HI wildseeker,

All you have to do is put that code, exactly as it is in a file. Call the file something like adsense.php

Then put this code:
<? include("adsense.php"); ?>
wherever you want the ads to show
The adsense.php file in this code assumes you have it placed in your root directory. If, for example you have this file in a folder called extras then just change the code to
<? include("extras/adsense.php"); ?>
__________________
|
Web Hosting Guru
| Need Help For Your Forum?
Reply With Quote
  #5 (permalink)  
Old 01-29-2004, 07:58 AM
WildSeeker's Avatar
WebProWorld Member
 

Join Date: Nov 2003
Location: New York City
Posts: 32
WildSeeker RepRank 0
Default

Thanks Cyanide -

I was able to get the code included with no problem. As it turned out, I was actually able to copy and paste the code, as is, directly into a table on the page I was working with.

I appreciate your help.
__________________
Regards,

Tim
WildSeeker
The Adventure Travel Resource
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0