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
-Guest-
post
Post #2





Goście







Ok juz prawie, jest jeszce jeden błąd z funkcę header

Kod
Warning: Cannot modify header information - headers already sent by (output started at c:\usr\krasnal\www\eurobarre\ebay.php:6) in c:\usr\krasnal\www\eurobarre\ebay.php on line 83


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