Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] "Szablony"
Axexis
post 17.12.2009, 18:07:35
Post #1





Grupa: Zarejestrowani
Postów: 98
Pomógł: 14
Dołączył: 13.01.2008
Skąd: Birmingham

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


Hi. smile.gif

Mamy sobie 2 pliki: index.php i ble.inc.php
plik index.php
[PHP] pobierz, plaintext
  1. <?php
  2. $a = "ble bla zmiennej a";
  3. $title = "tytul";
  4. $plik = file_get_contents('ble.inc.php');
  5. #
  6. eval("\$cos = \"".$plik."\";");
  7. echo $cos;
  8. ?>
[PHP] pobierz, plaintext

Plik ble.php
[PHP] pobierz, plaintext
  1. <html>
  2. <head>
  3. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  4. <meta http-equiv="content-language" content="pl" />
  5. <meta name="robots" content="noindex,nofollow" />
  6. <link rel="stylesheet" media="screen,projection" type="text/css" href="css/main.css" /> <!-- MAIN STYLE SHEET -->
  7. <script type="text/javascript" src="js/jquery.js"></script>
  8. <script type="text/javascript" src="js/switcher.js"></script>
  9. <script type="text/javascript" src="js/toggle.js"></script>
  10. <script type="text/javascript" src="js/ui.core.js"></script>
  11. <script type="text/javascript" src="js/ui.tabs.js"></script>
  12. <script type="text/javascript">
  13. $(document).ready(function(){
  14. $(".tabs > ul").tabs();
  15. });
  16. </script>
  17. <title>{$title}</title>
  18. </head>
  19. <body>
  20. Zmienna $c wynosi {$c}
  21. </body>
  22. </html>
[PHP] pobierz, plaintext

Pomysly?

Zgodnie z moimi oczekiwaniami winno wyświetlić: "Zmienna $a wynosi: ble"; jednak wywala mi błąd
Parse error: syntax error, unexpected T_STRING in /home/axexis/htdocs/index.php: eval()'d code on line 3

Jakies pomysly jak to ugryzc, ew. jak inaczej to zrobic?
Pozdrawiam

Ten post edytował Axexis 17.12.2009, 18:29:16


--------------------
  1. root@php.pl:~# rm -fr /


be. confused
Go to the top of the page
+Quote Post

Posty w temacie


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: 14.08.2025 - 15:16