Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> .
Chewolf
post
Post #1





Grupa: Zarejestrowani
Postów: 335
Pomógł: 0
Dołączył: 15.11.2003

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


.

Ten post edytował Chewolf 16.10.2007, 18:22:45
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
tiraeth
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 789
Pomógł: 41
Dołączył: 30.10.2003
Skąd: Wrocław

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


A ja bym to zrobił tak:

banners.txt
Kod
http://strona.com.pl||http://strona.com.pl/banner.jpg||

http://strona.com.pl||http://strona.com.pl/banner.jpg||

http://strona.com.pl||http://strona.com.pl/banner.jpg||

http://strona.com.pl||http://strona.com.pl/banner.jpg||

http://strona.com.pl||http://strona.com.pl/banner.jpg||

http://strona.com.pl||http://strona.com.pl/banner.jpg||


banners.php
[php:1:60a04808ad]<?php
$File = file('banners.txt');

$i = array_rand($File);

$Site = explode("||", $File[$i]);

// $Site[0] - adres strony
// $Site[1] - banner strony

echo '<a href="'.$Site[0].'" target="_blank"><img src="'.$Site[1].'" border="0"></a>';
?>[/php:1:60a04808ad]

Chyba lepiej aby bannery zapisywał w pliku aniżeli modyfikował kod w celu dodania bannera...
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: 26.12.2025 - 12:56