Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Tlo dla plikow inc*
cineck
post
Post #1





Grupa: Zarejestrowani
Postów: 98
Pomógł: 0
Dołączył: 8.12.2003
Skąd: Babimost City

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


witam...
mam nastepujacy problem (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) mam strone w php, i korzystam w plikow inc* znajdujacych sie w katalugu includes. I moje pytanie: czy mozna zrobic tak aby ten plik wyswietlajac text , mial rowniez kolorowe tlo (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) Bo u mnie jest ono biale. Probowalem roznych komend i jest ono nadal biale, a bardzo chcialbym wstawic tam jakis ladny kolorek tla.

Pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 9)
hwao
post
Post #2


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




A includujesz je czy jakos tak ( include require ?)
Pokad jakawlek kodu
Pozatym pamietaj ze include require wklejak do z pliku w te miejsce gdzie chcesz
Go to the top of the page
+Quote Post
cineck
post
Post #3





Grupa: Zarejestrowani
Postów: 98
Pomógł: 0
Dołączył: 8.12.2003
Skąd: Babimost City

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


Cytat(hwao @ 2004-07-01 16:23:20)
A includujesz je czy jakos tak ( include require ?)

Nie nic takiego nie robie. To co mi radzisz (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) w jaki sposob zrobic to najlatwiej.
Go to the top of the page
+Quote Post
hwao
post
Post #4


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




Przecierz przegladarka nie interpretuje plików *.inc jak chcesz otowrszyc http://strona.pl/cos.inc to w zyciu nie bedize to kolorowe (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Musisz dac rozszerzenie php lub html ( lub cos takiego )
Go to the top of the page
+Quote Post
cineck
post
Post #5





Grupa: Zarejestrowani
Postów: 98
Pomógł: 0
Dołączył: 8.12.2003
Skąd: Babimost City

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


ale ja nie otwieram www.cos.pl/ble.inc tylko www.cos.pl/index.php i tam w kodzie strony mam:
  1. <? if(!isset($page)) {
  2. $page=&#092;"index\";
  3. }
  4. if(file_exists(&#092;"includes/$page.inc\")) {
  5. include &#092;"includes/$page.inc\";
  6. } else {
  7. echo &#092;"Strona niedostępna!\";
  8. }
  9. ?>
i chce aby plik np. galeria.inc , ktora sie wyswietli w index.php miala tlo, rozumiesz (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) ? Bo chyba sie nie zrozumielismy (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
hwao
post
Post #6


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




  1. <?php
  2. <html> 
  3. <body bgcolor=&#092;"red\">
  4. <? if(!isset($page)) {
  5. $page=&#092;"index\";
  6. }
  7. if(file_exists(&#092;"includes/$page.inc\")) {
  8. include &#092;"includes/$page.inc\";
  9. } else {
  10. echo &#092;"Strona niedostępna!\";
  11. }
  12. ?>
  13. ?>

Na przyklad tak albo w includowanym pliku to daj
Go to the top of the page
+Quote Post
cineck
post
Post #7





Grupa: Zarejestrowani
Postów: 98
Pomógł: 0
Dołączył: 8.12.2003
Skąd: Babimost City

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


hmmm cos w tym kodzie chyba jest nie tak (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) bo gdy go wstawilem , po "odpaleniu" strony pokazuje mi sie nastepujace info:

Parse error: parse error in /home/www/cineck/miniportal/index.php on line 274 , (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) ?
Go to the top of the page
+Quote Post
hwao
post
Post #8


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




  1. <html> 
  2. <body bgcolor=\"red\">
  3. <?php if( !isset($page)) {
  4. $page=&#092;"index\";
  5. }
  6. if(file_exists(&#092;"includes/$page.inc\")) {
  7. include &#092;"includes/$page.inc\";
  8. } else {
  9. echo &#092;"Strona niedostępna!\";
  10. }
  11. ?>

& #33; zamien na !
Ten problem lezy tylko po stornie html'a nie php.
inlcude/require wkleja kod php w miescje tam gdzie jest include/require.
Go to the top of the page
+Quote Post
cineck
post
Post #9





Grupa: Zarejestrowani
Postów: 98
Pomógł: 0
Dołączył: 8.12.2003
Skąd: Babimost City

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


zmienilem nie ma bledu, strona sie laduje ale .... brak tla , jest takie jakie bylo - biale.
No robie tak jak podajesz (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) i nic ...

Ten post edytował cineck 3.07.2004, 15:18:58
Go to the top of the page
+Quote Post
Dabroz
post
Post #10





Grupa: Zarejestrowani
Postów: 286
Pomógł: 0
Dołączył: 1.11.2003
Skąd: Poland, Płock

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


  1. <html>
  2. <head>
  3. <style type=\"text/css\">
  4. body {background:yellow;}
  5. </head>
  6. <body>
  7. <pre>
  8. <?php
  9.  
  10. include('includes/'.basename($_GET['file']).'.php');
  11.  
  12. // basename to zabezpiecznie
  13.  
  14. ?>
  15. </pre>
  16. </body>
  17. </html>


I naprzyklad: www.strona.pl/text.php?file=tekst.inc
Go to the top of the page
+Quote Post

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: 22.08.2025 - 18:46