Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Niepoprawne wyświetlanie
Gibcio
post
Post #1





Grupa: Zarejestrowani
Postów: 48
Pomógł: 0
Dołączył: 20.04.2005

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


Mam taką funkcję w pliku function.php do wczytywania zawartości pliku:
  1. <?
  2. function ReadTemplate($name) {
  3. $mainTemplate = file_get_contents($name);
  4. return $mainTemplate;
  5. }
  6.  
  7. function Menu() {
  8. echo "Menu";
  9. }
  10. ?>

index.php

  1. <?
  2. $title = "Tytul";
  3. include('function.php');
  4. $mainTemplate = ReadTemplate("template/blue/index.html");
  5. $mainTemplate = str_replace("<!--TITLE-->", $title, $mainTemplate);
  6. $mainTemplate = str_replace("<!--MENU-->", Menu(), $mainTemplate);
  7. echo $mainTemplate;
  8. ?>


index.html
  1. <title><!--TITLE--></title>
  2. </head>
  3. <table border="0" width="100%">
  4. <tr>
  5. <td width="100%" align="center"><!--TOP--></td>
  6. </tr>
  7. </table>
  8.  
  9. <table border="0" width="100%">
  10. <tr>
  11. <td width="20%" align="center"><!--MENU--></td>
  12. <td width="60%" align="center"></td>
  13. <td width="20%" align="center"></td>
  14. </tr>
  15. </table>
  16. </body>
  17. </html>

Problem jest taki że napis w funkcji Menu nie pojawia się w tej tabelce tylko zupełnie na górze strony - jak to rozwiącać, proszę o pomoc.

Z góry dziękuje!

Ten post edytował Gibcio 25.08.2007, 17:52:57
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: 3.10.2025 - 07:00