View Full Version : I'm new and really need help with this ad thing!!
lionseye
10-20-2006, 06:46 PM
i've been search on the net for a week now. How do I advertise on my webpages. I mean so a different content is loaded up in the advertising box each time the page opened or refresh. There are loads of example of this kind of scripts in websites eg. advertising on yahoo and msn. the ads are normaly at the top or on the side and load randomly each time the page is loaded up. Please help someone! what kind of script do i use for this java, DHTML, CSS, or what exactly? Thanks
djr33
10-20-2006, 07:59 PM
look into google ads. They give you money and are easy to setup.
If you want that functionality for random content... take a look around DD... something should come close to what you want.
lionseye
10-21-2006, 01:11 PM
i've looked everywhere (feels like it thu). The closest thing i found was a random content text in DD.
What I need is for a table with a specifice size on my web page to load up at random flash (.SWF) or .GIF file when the page is loaded. From like a specified folder or sumin. Please help!
tech_support
10-23-2006, 07:28 AM
http://phpadsnew.com/two/
djr33
10-24-2006, 04:56 AM
Not sure on the code myself.
You probably want Javascript (though PHP or another server side language could work as well.)
There are lots of "random images" and "random content" threads around. Do a serach/take a look and try to find a script that might help, or a link to one, etc.
codeexploiter
10-26-2006, 06:01 AM
Check the following
1 (http://www.hscripts.com/scripts/php/bannerRotator.php)
2 (http://www.refdev.com/free_scripts/PHP/Ad_Management/more2.html)
3 (http://www.scriptdungeon.com/free_php_scripts/ad_management/free_php_scripts.php)
chechu
11-11-2006, 01:45 PM
Try this: (replace names img)
<script language="JavaScript">
images = new Array(3);
images[0] = "<a href=/peinture/ViergeAuxCoquillages/><img src='/accueil/ViergeAuxCoquillages_accueil.jpg' border=0></a>";
images[1] = "<a href=/dessin/ViteVite/><img src='/accueil/ViteVite_accueil.jpg' border=0></a>";
images[2] = "<a href=/peinture/EcceHomo/><img src='/accueil/EcceHomo_accueil.jpg' border=0></a>";
images[3] = "<a href=/dessin/Striptease/><img src='/accueil/Striptease_accueil.jpg' border=0></a>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
//done
// --></script>
tech_support
11-12-2006, 06:54 AM
Wrap your code in the [code] tags.
You shouldn't put the number for the array (3) because what if the user had more than 3 sets of ads?
You need to put type="text/javascript" in your script tag.
What if the user doesn't use images for ad's?
So, here's the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Ad Set Code</title>
<!-- No Script Style Code -->
<style type="text/css">
.ad {
display:none;
}
</style>
</head>
<body>
<!-- This is the area for ads with computers that don't support/disabled scripting ability -->
<noscript>
<div id="noScriptAds">Add your no-script ad code here</div>
</noscript>
<!-- End Area -->
<div id="adSet1" class="ad">Ad Set 1</div>
<div id="adSet2" class="ad">Ad Set 2</div>
<div id="adSet3" class="ad">Ad Set 3</div>
<script type="text/javascript">
var adSets = 3 //How many ad sets are there
function randomAd() {
hideAds(adSets+1)
var i = Math.floor(Math.random() * adSets) + 1
var adCookie = getCookie('ad')
if (adCookie == i) {
setTimeout("randomAd()",1)
}
document.getElementById("adSet"+i).style.display = "block"
setCookie('ad',i,1)
}
function hideAds(no) {
for (i=1;i < no;i++) {
document.getElementById("adSet"+i).style.display = "none"
}
}
function getCookie( name ) {
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}
function setCookie( name, value, expires, path, domain, secure ) {
var today = new Date();
today.setTime( today.getTime() );
if ( expires ) {
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );
document.cookie = name+"="+escape( value ) +
( ( expires ) ? ";expires="+expires_date.toGMTString() : "" ) + //expires.toGMTString()
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
function deleteCookie( name, path, domain ) {
if ( getCookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
window.onload = randomAd;
</script>
</body>
</html>
Added: Cookie saving so ads are different every page load
Arctic Fox
12-01-2006, 03:50 PM
Nice!
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.