Computing.Net > Forums > Web Development > random ads

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

random ads

Reply to Message Icon

Name: sanjeetbisht
Date: March 17, 2009 at 23:14:11 Pacific
OS: Windows XP
CPU/Ram: p4 256 ram
Product: Lg electronics / My pc
Subcategory: General
Comment:

hello,
i am using wordpress
the problem is that how to display random ads
on it
i have find the place where the ad is automatically added when we post but i am
using adbrite and i have 4 adzone i want that
when page is loaded the 4 ads get randomly
displayed atleast 1 time each and can repeat
after ever post


please help me
thanks



Sponsored Link
Ads by Google

Response Number 1
Name: Radix-64
Date: March 18, 2009 at 14:25:00 Pacific
Reply:

Hi, perhaps try coding an ad randomizer in PHP using the rand() function. Just assign each image and a link a number, and the banner that matches to the random number generated is displayed.

$Img1 = "http://domain.com/image1.jpg";
$Url1 = "http://domainname.com";

$Img2 = "http://domain.com/image2.jpg";
$Url2 = "http://domainname.com";

$Img3 = "http://domain.com/image3.jpg";
$Url3 = "http://domainname.com";

$Img4 = "http://domain.com/image4.jpg";
$Url4 = "http://domainname.com";

$random = rand(1, 4);

$Image = ${'Img'.$num};
$URL = ${'Url'.$num};

Then insert your print or echo PHP code here using the $Image for the 'img src' and $URL for the 'a href' variables.


0

Response Number 2
Name: sanjeetbisht
Date: March 18, 2009 at 19:57:36 Pacific
Reply:

hey thanks for it
but i want that i want to randomly display adbrite.com ads
they are like adsense

please help me


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


problem in uploading a fi... free web host help



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: random ads

Pop-Up Ads www.computing.net/answers/webdevel/popup-ads/2190.html

Getting click on Ads/HTML Layering www.computing.net/answers/webdevel/getting-click-on-adshtml-layering/882.html

Making ads with code www.computing.net/answers/webdevel/making-ads-with-code/2718.html