Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 21-02-06
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
clairey is an unknown quantity at this point
  Page re-load to show ads randomly

Hi
I am looking for some advice / help
I have a listings website, and would like to have the first 5 or so listings randomly re-shuffled so a different one shows at the top every time the page is visited/re-loaded. Does anyone know of some code / a program that can do this? My html is fairly basic, javascript even more basic ... don't know where to start ... anyone have any advice / pointers?
Thank you
Claire
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 21-02-06
Aquanuke's Avatar
ShagaaDaggaDoo
 
Join Date: Aug 2003
Location: Surrey
Posts: 1,116
Thanks: 0
Thanked 0 Times in 0 Posts
Aquanuke is an unknown quantity at this point
Do a search for iframes.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 21-02-06
Aquanuke's Avatar
ShagaaDaggaDoo
 
Join Date: Aug 2003
Location: Surrey
Posts: 1,116
Thanks: 0
Thanked 0 Times in 0 Posts
Aquanuke is an unknown quantity at this point
Or in PHP create a page with just the ad and a meta refresh at the top then in your PHP that is to show the ad use the php include..

PHP Code:
<?
include 'adverts.php';
?>
http://uk2.php.net/include/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 21-02-06
Registered User
 
Join Date: Feb 2006
Location: Gillingham
Posts: 503
Thanks: 0
Thanked 0 Times in 0 Posts
Donk is an unknown quantity at this point
You could try something like:


PHP Code:
<?php 
$i
=rand(1,5);
switch (
$i) {
case 
1:
   echo 
'<a href= "link1"><img src="image1.jpg"></a>';
   break;
case 
2:
   echo 
'<a href= "link2"><img src="image2.jpg"></a>';
   break;
case 
3:
   echo 
'<a href= "link3"><img src="image3.jpg"></a>';
   break;
case 
4:
   echo 
'<a href= "link4"><img src="image4.jpg"></a>';
   break; 
case 
5:
   echo 
'<a href= "link5"><img src="image5.jpg"></a>';
   break; 
}
?>
bob
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 21-02-06
Registered User
 
Join Date: Feb 2006
Location: London Kent border
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Doghouse is an unknown quantity at this point
Hi, I've only just registered with this forum yesterday, however, as I've been teaching myself php for some time now, I've used a few developer forums and reading your post reminded me of something that I printed off a forum ages ago and would hopefully use myself once I was ready. If you are new to php, it is good starting point as it might outline what might required for you you to achieve this.
As I'm not totally sure what you list on your website, I'm assuming that you mean affiliate banners linking to various merchants. I've taken a different approach to displaying them as I've made a menu down the side of the page where the user selects the relevant banners to be displayed of interest to the user. Also, I use cookies and have a users database to enable me in the future to just display the banners which reflect the users searching history of subject matter.
Anyway, I hope this url link will be of some use.
http://www.sitepoint.com/article/pic...wcase-php-html
cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 21-02-06
drivetowin's Avatar
Driving to win
 
Join Date: Aug 2003
Location: If I'm not at home, I'm in hospital
Posts: 7,363
Thanks: 5
Thanked 8 Times in 5 Posts
drivetowin seems to know their stuff
You could have a look at phpadsnew and set up a number of zones on your page.

Phpadsnew will then take care of the rotation for you.
__________________
Never argue with idiots. They just drag you down to their level and then beat you with their experience.

If ignorance is bliss then some of the people I know must be orgasmic.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 21-02-06
eskimo's Avatar
Registered User
 
Join Date: Aug 2003
Posts: 659
Thanks: 0
Thanked 0 Times in 0 Posts
eskimo is an unknown quantity at this point
If you want a quick and easy method you are probably better of sticking with a javascript solution.

Have alook at this example, a bit of cut and paste and you should have it working in no time.
http://www.javascriptkit.com/script/cut149.shtml
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #8 (permalink)  
Old 22-02-06
Registered User
 
Join Date: Mar 2004
Location: Reading, UK
Posts: 301
Thanks: 0
Thanked 0 Times in 0 Posts
dmorison is an unknown quantity at this point
Nothing better than a JavaScript challenge for Breakfast to get the brain in gear for the day

Have a go with this - it will put all paragraphs (p tags) within the div having id='container' in random order. If the client doesn't have JavaScript enabled it doesn't matter; they'll just stay in the order you code them in.
HTML Code:
<html>
  <body>  
    <div id='container'>
      <p>This is paragraph 1</p>
      <p>This is paragraph 2</p>
      <p>This is paragraph 3</p>
      <p>This is paragraph 4</p>
      <p>This is paragraph 5</p>
    </div>  
    <script type='text/javascript'>    
    var container = document.getElementById("container");    
    container.style.visibility = 'hidden';    
    var elements = container.getElementsByTagName("p");    
    var temp = "";
    var swap = 0;
    for(var i = 0;i < elements.length;i++)
    {
      temp = elements[i].innerHTML;
      swap = Math.floor(Math.random()*elements.length);
      elements[i].innerHTML = elements[swap].innerHTML;
      elements[swap].innerHTML = temp;
    }    
    container.style.visibility = 'visible';    
    </script>    
  </body>
</html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 26-02-06
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
clairey is an unknown quantity at this point
Thanks everyone for your help, have now got it up and running with javascript
Claire
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seach Engine Optimisation FAQ [Jan2006] thetafferboy Organic Google Search Optimisation 2 09-01-06 05:11 PM
Page load prob Mogga Affiliate Future 0 23-07-05 01:22 PM
anyone know about Google changing to CPM from CPC? Helen The Affiliate Marketing Lounge 11 27-04-05 02:11 PM
Ads linking to page Bod Organic Google Search Optimisation 3 24-02-05 10:00 PM
Unable to load Affiliate4u web page zapo31 The Affiliate Marketing Lounge 4 05-03-04 04:02 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top
<