Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Banner rotation in variable
pt4siek
post 29.01.2003, 00:50:31
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 20.01.2003

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


i'i d like to include banner rotation script to my site. while i was working on html it was simple:
?php include "banner.php"; ?>
but now i have to include banner.php into $footer variable
how can i do something like this?:
$footer="
-||html code||-
and here i want to inlude that banner.php
-||html code||-
";
questionmark.gif?
Go to the top of the page
+Quote Post
kurtz
post 29.01.2003, 11:04:04
Post #2





Grupa: Przyjaciele php.pl
Postów: 786
Pomógł: 0
Dołączył: 18.03.2002
Skąd: Wroclaw/Warszawa

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


Cytat
i'i d like to include banner rotation script to my site. while i was working on html it was simple:
?php include "banner.php"; ?>
but now i have to include banner.php into $footer variable
how can i do something like this?:
$footer="  
-||html code||-
and here i want to inlude that banner.php
-||html code||-
";
???

polacz kod HTML z includem banera w jeden plik .php ktory pobierzesz przez sockety albo (jesli mozesz) przez file('http://localhost/tenskrypt.php'). wtedy zawartosc mozesz spokojnie przypisac do zmiennej.

ps
tylko po kiego ten post po angielsku?..


--------------------
.. make web your home ..
Go to the top of the page
+Quote Post
scanner
post 29.01.2003, 11:08:25
Post #3





Grupa: Zarząd
Postów: 3 503
Pomógł: 28
Dołączył: 17.10.2002
Skąd: Wrocław




Może żeby wyszło bardziej 'profesjonalnie'?


--------------------
scanner.info
Warto pamiętać: KISS, DRY
Go to the top of the page
+Quote Post
DeyV
post 29.01.2003, 11:48:37
Post #4





Grupa: Zarząd
Postów: 2 277
Pomógł: 6
Dołączył: 27.12.2002
Skąd: Wołów/Wrocław




A może tak:
Kod
ob_start();



  include "banner.php";

  

$var=ob_get_contents();



ob_end_clean();

Kod
$footer="

-||html code||-

|| $var ||

-||html code||-
Czy też coś takiego miałeś na myśli?


--------------------
"Niezależnie od tego, jakie masz osiągnięcia, ktoś Ci pomaga..."
Go to the top of the page
+Quote Post
kurtz
post 29.01.2003, 12:34:31
Post #5





Grupa: Przyjaciele php.pl
Postów: 786
Pomógł: 0
Dołączył: 18.03.2002
Skąd: Wroclaw/Warszawa

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


Cytat
A może tak:
Kod
ob_start();



  include "banner.php";

  

$var=ob_get_contents();



ob_end_clean();

Kod
$footer="

-||html code||-

|| $var ||

-||html code||-
Czy też coś takiego miałeś na myśli?

bosze. no tak - oczywiscie ob_get_contents() to njaprotsze rozwiazanie. DeyV: tak, masz jak najbardziej racje ;)

przepraszam ze przekombinowanie wczesniej.


--------------------
.. make web your home ..
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 27.04.2024 - 09:52