Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Includowanie strony
piotrek442
post
Post #1





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

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


Mam problem z includowaniem strony z pewną zmienną

Robie to tak:

  1. switch($_GET['page']) {
  2.  
  3. case 'profile':
  4. include 'profile.php?id='.$user_data['user_id'].'';
  5. break;
  6. }


a link do tej prodstrony taki :
  1. <a href="index.php?page=profile">Wyświetl swój profil</a>


niestety mi wyskakuje błąd ;/

Warning: include(profile.php?id=1) [function.include]: failed to open stream: No such file or directory in...
Warning: include() [function.include]: Failed opening 'profile.php?id=1' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in ..

proszę o pomoc , nie wiem jak sobie z tym poradzić
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 9)
!*!
post
Post #2





Grupa: Zarejestrowani
Postów: 4 298
Pomógł: 447
Dołączył: 16.11.2006

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


Chyba nie bardzo, pomyliłeś linki. ups.

  1. include 'profile.php?id='.$user_data['user_id'];

link > profile.php?id=1

A komunikat mówi jasno, nie masz takiego pliku jak profile.php lub podałeś do niego złą ścieżkę.

Ten post edytował !*! 13.04.2013, 11:15:25
Go to the top of the page
+Quote Post
Michael2318
post
Post #3





Grupa: Zarejestrowani
Postów: 651
Pomógł: 116
Dołączył: 3.06.2012
Skąd: Lędziny

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


Jaki efekt chcesz osiągnąć...? Może chodzi Ci o file_get_contents? Przecież w include definiujesz tylko nazwę pliku wraz z rozszerzeniem i to wystarczy.
Go to the top of the page
+Quote Post
piotrek442
post
Post #4





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

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


sam już się w tym pogubiłem ...

w index.php mam ten system z includowaniem stron.
index.php jest umieszczony w tym samym katalogu co profile.php( i on istnieje)
Go to the top of the page
+Quote Post
!*!
post
Post #5





Grupa: Zarejestrowani
Postów: 4 298
Pomógł: 447
Dołączył: 16.11.2006

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


a tak:

  1. include './profile.php?id='.$user_data['user_id'];
Go to the top of the page
+Quote Post
piotrek442
post
Post #6





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

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


Warning: include(./profile.php?id=1) [function.include]: failed to open stream: No such file or directory in ...


a jak dam samo 'profile.php' to plik istnieje ;//

Ten post edytował piotrek442 13.04.2013, 11:23:20
Go to the top of the page
+Quote Post
!*!
post
Post #7





Grupa: Zarejestrowani
Postów: 4 298
Pomógł: 447
Dołączył: 16.11.2006

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


Ehh mam dziś zaćmienie (IMG:style_emoticons/default/biggrin.gif) musisz includować sam plik profile.php bez GET, a i tak ten parametr zostanie wczytany.
Go to the top of the page
+Quote Post
piotrek442
post
Post #8





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

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


dziękuje Ci bardzo!! działa!
Go to the top of the page
+Quote Post
Michael2318
post
Post #9





Grupa: Zarejestrowani
Postów: 651
Pomógł: 116
Dołączył: 3.06.2012
Skąd: Lędziny

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


piotrek442 napisałem Ci to już w drugim poście (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
piotrek442
post
Post #10





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

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


no nie ogarnąłem tematu (IMG:style_emoticons/default/smile.gif) ale już wszystko OK!
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: 24.08.2025 - 04:29