Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Includowanie forum z folderu
Morduk
post
Post #1





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

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


Siemka,
jak w php zrobić, aby plik includował poprawnie forum znajdujące się w folderze 'forum'.
Próbowałem prze zwykłe include, ale nie działa, ponieważ chyba nie może pobrać danych z innych plików znajdujących się tam.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Morduk
post
Post #2





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

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


Niestety (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) Nie zadziałało.

Ale wyświetla mi się coś takiego:
Kod
Warning: include(./extension.inc) [function.include]: failed to open stream: No such file or directory in E:\xampp\htdocs\www\web\forum\index.php on line 26

Warning: include() [function.include]: Failed opening './extension.inc' for inclusion (include_path='.;E:\xampp\php\pear\') in E:\xampp\htdocs\www\web\forum\index.php on line 26

Warning: include(./common.) [function.include]: failed to open stream: No such file or directory in E:\xampp\htdocs\www\web\forum\index.php on line 27

Warning: include() [function.include]: Failed opening './common.' for inclusion (include_path='.;E:\xampp\php\pear\') in E:\xampp\htdocs\www\web\forum\index.php on line 27

Warning: include(./includes/functions_selects.) [function.include]: failed to open stream: No such file or directory in E:\xampp\htdocs\www\web\forum\index.php on line 28

Warning: include() [function.include]: Failed opening './includes/functions_selects.' for inclusion (include_path='.;E:\xampp\php\pear\') in E:\xampp\htdocs\www\web\forum\index.php on line 28

Fatal error: Call to undefined function session_pagestart() in E:\xampp\htdocs\www\web\forum\index.php on line 79


Chodzi mi o zaincludowanie skryptu forum phpBB modyfited by przemo.

Includuje pliki do index.php za pomocą skryptu:

  1. <?php
  2. if (!empty($_GET['p'])) {
  3.       $name = urldecode($_GET['p']);
  4.       $reg = '/^[a-zA-Z0-9]+$/';
  5.       if (preg_match($reg, $name)) {
  6.           if (file_exists($name.'.php')) {
  7.               include($name.'.php');
  8.           }else{
  9.               echo '<center>Plik nie istnieje!</center>';
  10.           }
  11.       }else{
  12.           echo 'Niedozwolone znaki w nazwie pliku';
  13.       }
  14.   }else{
  15.       include('news.php');
  16.   }
  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: 31.12.2025 - 11:38