Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Rotator banerów, odśwież co 20 sek.
-Garbacz-
post
Post #1





Goście







Witam, czy można stworzyć prosty rotator banerów z częstotliwością odświeżania 20 sekunk??

Czyli co 20 sekund jest nowy baner??

Czy można to zrobić bez bazy mysql??

samo czyste php??
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
strife
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 605
Pomógł: 96
Dołączył: 22.10.2004
Skąd: UK

Ostrzeżenie: (0%)
-----


1. Używaj poprawnego bbCode!

2.
  1. <?php
  2. // rotator banerow
  3.  
  4. $array[1] = '<script language="javascript">var uri = 'http://imppl.tradedoubler.com/imp/img/16173458/1184633?' + new String (Math.random()).substring (2, 11);
  5. document.write('<a href="http://clk.tradedoubler.com/click?p=39590&a=1184633&g=16173458" target="_blank"><img src="'+uri+'" border=0></a>');
  6. </script>';
  7.  
  8. $array[2] = '<script language="javascript">
  9. var uri = 'http://imppl.tradedoubler.com/imp/img/1128784/1184633?' + new String (Math.random()).substring (2, 11);
  10. document.write('<a href="http://clk.tradedoubler.com/click?p=22131&a=1184633&g=1128784" target="_blank"><img src="'+uri+'" border=0></a>');
  11. </script>';
  12.  
  13. $array[3] = 'bannerek 3';
  14. $array[4] = 'bannerek 4';
  15. $array[5] = 'bannerek 5';
  16.  
  17. $czas = 5; // 5 sekund
  18.  
  19. $url = (int)$_GET['x'];
  20.  
  21. if ( empty ( $url ) or $url >= count ( $array ) )
  22. {
  23.    $url = 1;
  24. }
  25. else
  26. {
  27.    $url++;
  28. }
  29. echo $array[$url];
  30.  
  31. header( "Refresh: " . $czas . "; URL=?x=" . $url );
  32.  
  33. ?>

Nie miałeś przez ' wstawionego znaku \ który informuje iż nie będzie on traktowany specjalnie, jeśli jesteś dociekliwy poszukaj...

Pozdrawiam!
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 23:41