Randon Number Generation - Ad Network

They have: 5,633 posts

Joined: Jan 1970

Hi there...

I just signed up with 247media to carry their banner advertisements on my websites.

The code they sent me contains a javascript code like this:

<script LANGUAGE="JavaScript1.1" SRC="http://network.realmedia.com/RealMedia/ads/adstream_jx.ads/CanSeek.ca/ron/roc/ss/[PAGE]/1[RANDOMNUMBER]@Position1?keywords"></script>

The [PAGE] portion I can look after. It just tells the network which section of my website ads are being served from. The [RANDOMNUMBER] section is my problem.

I run a mixture of static html pages (which could be converted to shtml supporting ssi no problem) and php pages as well.

They are suggesting I use server side randon number generation. I own Adcycle, would this work? I can put AdCycle code on all webpages but need a way to incorporate a random number into the ad code on *every* page served up.

If not, is there a PHP and SSI method I can use?

Thanks for any help.. really hoping to find someone who has dealt with this before...

Paul

cmonkey's picture

He has: 19 posts

Joined: Jul 2004

You could definatly do it with PHP, just have php generate the random number (whatever length you want) and insert it into the javascript code where you need it

ie

<?php
$num
= rand([min value], [max value]);

echo
$rand;
?>

The <? echo $rand; ?> could be inserted into your actual javascript code.

Hope that helps

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.