Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Wyświetlenie pliku php
Strarus
post
Post #1





Grupa: Zarejestrowani
Postów: 339
Pomógł: 12
Dołączył: 22.11.2008

Ostrzeżenie: (20%)
X----


siema
Jak mogę wyświetlić zawartość pliku kod.txt, w którym jest kod php?? Jak używam include, to mi includuje kod z pliku...Najlepiej aby jeszcze do tego było highlight_file (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Strarus
post
Post #2





Grupa: Zarejestrowani
Postów: 339
Pomógł: 12
Dołączył: 22.11.2008

Ostrzeżenie: (20%)
X----


Teraz kod.txt wygląda tak:
Kod
if(isset( $_GET[ 'site' ] )){
$site = htmlspecialchars( $_GET['site'] ) .'.inc.php';
if( file_exists( $site )){
include( $site );
}else{
echo'strona o podanym adresienie istnieje';
}
}else{
echo ':)';
}
Więc nie ma < i > (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) A nadal nie działa (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)

Edit:

Jak dałem:
Kod
&lt?php
if(isset( $_GET[ 'site' ] )){
$site = htmlspecialchars( $_GET['site'] ) .'.inc.php';
if( file_exists( $site )){
include( $site );
}else{
echo'strona o podanym adresienie istnieje';
}
}else{
echo ':)';
}
?&gt

i :
  1. <?php
  2. include('kod.txt');
  3. ?>
To mi includuje poprawnie, czyli wyświetla ten ciąg z kod.txt, ale jak dodać do tego highlight_file (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)

Ten post edytował Strarus 3.01.2009, 17:30:17
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: 9.10.2025 - 07:58