Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> include, $_GET
Matuzalem
post
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 2.11.2007

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


Witam

Czy jest jakiś sposób, aby przekazać zmienną poprzez get używając include?
czyli np.

include("./page/pagex.php?path=line");

a może coś alternatywnego?

Pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
DeadMan
post
Post #2





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 19.12.2006

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


  1. <?php
  2. print_r($_GET)
  3. ?>
Go to the top of the page
+Quote Post
Matuzalem
post
Post #3





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 2.11.2007

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


Znaczy się my się chyba nie zrozumieliśmy.
Gdy dodam do kodu:

include("./subpages/template_flashver.php?path=graphics");

dostaje ostrzeżenie:

Warning: include(./subpages/template_flashver.php?path=graphics) [function.include]: failed to open stream: No such file or directory in /home/qyi46720/public_html/test_page2/index.php on line 33


Gdy usunę "?path=graphics" w tedy nie dostaję owego ostrzenienia.
Czym to jest spowodowane?

Pozdrawiam

Znalazłem to: http://php-manual.skryptoteka.pl/function.include.html

Jednak gdy wykonam podane rozwiązanie nawe bez przekazywania argumentów strona jest "pisana" tylko do momentu include a potem nie ma nic...

Pozdrawiam

Ten post edytował Matuzalem 6.11.2007, 01:40:07
Go to the top of the page
+Quote Post
Darti
post
Post #4





Grupa: Zarejestrowani
Postów: 1 076
Pomógł: 62
Dołączył: 6.03.2005
Skąd: Wroc

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


Nie tędy droga.
Przekaż zmienną w taki sposób:
  1. <?php
  2. $path = 'line';
  3. include(page/pagex.php);
  4. ?>


plik pagex.php:
  1. <?php
  2. echo $path; // wyswietli line
  3. ?>


--------------------
The answer is out there, Neo. It's looking for you. And it will find you, if you want it to.
SERVER_SOFTWARE : Apache/2.2.4 (Win32) PHP/5.2.1
MySQL Client API version : 5.0.27
Go to the top of the page
+Quote Post
Matuzalem
post
Post #5





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 2.11.2007

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


Dzięki.
Jak zwykle staram sobie skomplikować życie tongue.gif
Pozdrawiam
Go to the top of the page
+Quote Post

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 Aktualny czas: 20.08.2025 - 04:27