Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Banner Script


  • Please log in to reply

#1
Knoore

Knoore

    Member

  • Member
  • PipPip
  • 13 posts
I'm having a trouble with php, I'm making a banner script, which both, auto refreshes after 15 seconds(and picks a random banner with fitting link) and takes a random banner on load of page.
The second part is working, but i cant get the first part working:(

http://www.knoore.com/test4/banner.php
This is located in the banner.php file
<style type="text/css">body {background-image: url("http://www.knoore.com/test/files/images/achtergrond.gif");}</style>
<?php
$bannerammount=3;
$rnd=rand (1,$bannerammount);
if ($rnd == "1") {$link="http://www.woneninonderbanken.nl";$image="http://www.knoore.com/test/files/banners/1.gif";$alt="Alt1";$tekst="Tekst 1";}
if ($rnd == "2") {$link="http://www.woneninonderbanken.nl";$image="http://www.knoore.com/test/files/banners/1.gif";$alt="Alt2";$tekst="Tekst 2";}
if ($rnd == "3") {$link="http://www.woneninonderbanken.nl";$image="http://www.knoore.com/test/files/banners/1.gif";$alt="Alt3";$tekst="Tekst 3";}
?>
<html><div align="center"><a href="<?php echo $link ?>" target="_blank"><img src="<?php echo $image ?>" alt="<?php echo $alt ?>" border="0"><br><?php echo $tekst ?></a></div></html>

Now I’m wondering if its possible to make it auto refresh this content
<?php
$bannerammount=3;
$rnd=rand (1,$bannerammount);
if ($rnd == "1") {$link="http://www.woneninonderbanken.nl";$image="http://www.knoore.com/test/files/banners/1.gif";$alt="Alt1";$tekst="Tekst 1";}
if ($rnd == "2") {$link="http://www.woneninonderbanken.nl";$image="http://www.knoore.com/test/files/banners/1.gif";$alt="Alt2";$tekst="Tekst 2";}
if ($rnd == "3") {$link="http://www.woneninonderbanken.nl";$image="http://www.knoore.com/test/files/banners/1.gif";$alt="Alt3";$tekst="Tekst 3";}
?>
<html><div align="center"><a href="<?php echo $link ?>" target="_blank"><img src="<?php echo $image ?>" alt="<?php echo $alt ?>" border="0"><br><?php echo $tekst ?></a></div></html>
Every 15 seconds.
If i refresh this:
<style type="text/css">body {background-image: url("http://www.knoore.com/test/files/images/achtergrond.gif");}</style>
then the screen turns white for like 1 second, because it has to reload the background and such. Therefore it can't be refreshed.

Can any1 help me with solving this problem?
Thanks in Advance,
Knoore

Edited by Knoore, 21 July 2005 - 05:21 PM.

  • 0

Advertisements


#2
Knoore

Knoore

    Member

  • Topic Starter
  • Member
  • PipPip
  • 13 posts
Yes i do, and i found out to, i posted yes:) but changed it after :tazz:
  • 0

#3
ssone

ssone

    Member

  • Member
  • PipPipPip
  • 301 posts
so you want this to refresh every 15 seconds, right?
  • 0

#4
Knoore

Knoore

    Member

  • Topic Starter
  • Member
  • PipPip
  • 13 posts
yes but not with Meta Refresh, cause then the whole page reloads, and then you see it flash white :tazz: cause it reloads the background image
  • 0

#5
ssone

ssone

    Member

  • Member
  • PipPipPip
  • 301 posts
k why dont u want to use javascript?
  • 0

#6
Knoore

Knoore

    Member

  • Topic Starter
  • Member
  • PipPip
  • 13 posts
because i dont know ******** about java script :tazz:
then i need some1 to completely make it for me, else i dont know what to do ;)
  • 0

#7
ssone

ssone

    Member

  • Member
  • PipPipPip
  • 301 posts
well thats wat id have to do right now with php..
  • 0

#8
Knoore

Knoore

    Member

  • Topic Starter
  • Member
  • PipPip
  • 13 posts
Well i dont mind how you help me, as long as you do :tazz:
  • 0

#9
ssone

ssone

    Member

  • Member
  • PipPipPip
  • 301 posts
k this is what you want right (with a banner tho)..:


...:::...::.:.:::..::...
  • 0

#10
admin

admin

    Founder Geek

  • Community Leader
  • 24,639 posts
Take a look at PHPAds
  • 0

#11
ssone

ssone

    Member

  • Member
  • PipPipPip
  • 301 posts
yeh i have tons of php banner ad scripts but javascript will be about the same to configure, and easier to set up.
  • 0

#12
ssone

ssone

    Member

  • Member
  • PipPipPip
  • 301 posts
I kno the ad is a little squished u can resize everything to fit your ad, that add is really supposed to be a big box-like ad..

k well let me kno if thats what you want and I'll zip the stuff for you.
  • 0

#13
Knoore

Knoore

    Member

  • Topic Starter
  • Member
  • PipPip
  • 13 posts
Yeah this looks like osmething i would need, but i think this goes in a specific order. I need a script that goes random hehe
  • 0

#14
Knoore

Knoore

    Member

  • Topic Starter
  • Member
  • PipPip
  • 13 posts
Now i got this Banner code (Javascript)
How to make it refresh? without this line <meta http-equiv="refresh" content="15" onLoad="images/achtergrond.gif">
<meta http-equiv="refresh" content="15" onLoad="images/achtergrond.gif">
<style type="text/css">body {background-image: url(images/achtergrond.gif);}</style>
<script>
gfx0="banners/1.gif";lnk0="adverteren.html";alt0="Uw Advertentie Hier?";txt0="Uw Advertentie Hier?";
len=1;today=new Date();today=today.getTime();rnd=today%len;
document.writeln('<div align="center"><A HREF="'+eval("lnk"+rnd)+'" target="_Blank" ><IMG SRC="'+eval("gfx"+rnd)+'" border=0 ALT="'+eval("alt"+rnd)+'"><BR>'+eval("txt"+rnd)+'</A></div>');</SCRIPT>
<div align="center"><a href="http://www.woneninonderbanken.nl" target="_blank"><img src="images/terugkerennaarwoneninonderbanken.gif" border="0" width="300" height="30"></a></div>

Edited by Knoore, 22 July 2005 - 06:48 AM.

  • 0

#15
Knoore

Knoore

    Member

  • Topic Starter
  • Member
  • PipPip
  • 13 posts
I guess i just leave it as it is now. A little white flash only draws attention to the banners :tazz:.

Now lets get working on this ;)
http://www.geekstogo...top-t46492.html
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP