Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Display ads on multiple websites
Old 07-08-2011, 08:54 AM Display ads on multiple websites
Experienced Talker

Posts: 45
Location: Canada
Trades: 0
Hey guys,

I'm not sure if this is the right place to post. I own multiple websites and to sell advertisement on all of them simultaneously from one place. So I don't want to manually put the code for banner on all the websites but just do from one place from the admin area.

Can this be done in PHP. Is there some free script already available?


Thank you.
Jaspworld is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-08-2011, 09:44 AM Re: Display ads on multiple websites
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Quote:
Originally Posted by Jaspworld View Post
Can this be done in PHP.
Yes. There are several ways you could approach this. One way would be to setup a script that would serve the ads and then fetch the output of that script in each site.

Here is a simplified example of how you might output the ad, assuming you have a script called 'adserver.php' that generates the ads:
PHP Code:
$server 'http://yoursite.com/adserver.php';

$ad file_get_contents($server);
echo 
$ad
A better approach might be to use ajax to retrieve the ad after the page is already loaded.

Another way to accomplish this would be to setup a library that would retrieve ad information from a database that each site has access to.

Quote:
Originally Posted by Jaspworld View Post
Is there some free script already available?
Probably, but it's hard to say without knowing more specifically what you need.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by NullPointer; 07-08-2011 at 09:51 AM..
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 07-08-2011, 09:59 AM Re: Display ads on multiple websites
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Just use javascript and provide the publishers a remote script, Google Adsense style.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-08-2011, 10:02 AM Re: Display ads on multiple websites
Experienced Talker

Posts: 45
Location: Canada
Trades: 0
Thanks for the reply. I definitely won't be coding this myself but it's great to get some insight into this.

I found something but they're pretty expensive :
http://www.yourfreeworld.com/script/textads.php

I'm not looking for someone to sell my ads for me or to join some network. On all my websites I'll have a link "Advertise with us". When someone is interested they can fill out a form or send me an e-mail and I'll go to the admin area, approve their website (after payment), and their ad is displayed on all the websites.


Thank you.
Jaspworld is offline
Reply With Quote
View Public Profile
 
Old 07-08-2011, 10:08 AM Re: Display ads on multiple websites
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
I definitely won't be coding this myself
Why not?

It not a particularly complex script just to write a few lines of text into an element on the page,
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 07-08-2011 at 10:10 AM..
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-08-2011, 11:04 AM Re: Display ads on multiple websites
Experienced Talker

Posts: 45
Location: Canada
Trades: 0
I had the impression that this would be very complicated and wanted to leave it to professional coders.

How would I do this using javascript? Can someone please give me a simple example using a text link. Once again I can't help but ask if there's a open source script like adsense available. That's because I would also like my advertisers to have stats avaialble (impressions, clicks), chose color of ads etc.

Thanks.
Jaspworld is offline
Reply With Quote
View Public Profile
 
Old 07-08-2011, 12:37 PM Re: Display ads on multiple websites
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
At it's simplest:

Code:
function showAd(){
	document.write('<br />');
	document.write('<a href="http://www.google.com">Anchor Text</a>');
	document.write('<br />');
}
Above is a remote script on your server.


this to include the remote script
HTML Code:
<script src="http://www.ad-serv.co.uk/ads.js" type="text/javascript"></script>
and
HTML Code:
<script type="text/javascript">
	showAd();
</script>
To put the advert on the page

the script is live BTW if you want to make sure it works on your pages.

That's very rudimentary and tracking and stats can be written in to give impressions and clicks etc.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-08-2011, 02:08 PM Re: Display ads on multiple websites
Experienced Talker

Posts: 45
Location: Canada
Trades: 0
Hello,
Yes, that works great . I've realized that I'll have to stop being lazy and do this myself. That gives me more freedom to do what I want. I'll be posting here again when I want to add more features and stuff.

Thank you.
Jaspworld is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Display ads on multiple websites
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.66353 seconds with 12 queries