Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Serwer nie czyta mi elementów php
lobuznica
post 26.12.2004, 21:57:35
Post #1





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

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


Mam problem, mam prosty skrypt php, ktory ma zczytywac kolejne strony do strony głównej:
<a class="a" href="index.htm?element=1">firma</a>&nbsp&nbsp
<a class="a" href="index.htm?element=2">oferta</a>&nbsp&nbsp
<a class="a" href="index.htm?element=3">galeria</a>&nbsp&nbsp
<a class="a" href="index.htm?element=4">kontakt</a>&nbsp&nbsp
<a class="a" href="index.htm?element=5">mapa witryny</a>
<?php
$element = isset($HTTP_GET_VARS["element"]) ? $HTTP_GET_VARS["element"] : 1;
switch($element)
{
case 1:
include("firma.html");
break;
case 2:
include("oferta.html");
break;
case 3:
include("galeria.html");
break;
case 4:
include("kontakt.html");
break;
case 5:
include("mapa.html");
break;
default:
include("firma.html");
}
?>
Problem polega na tym ze jeden serwer, na ktorym mam strone czyta bez problemu to php, a drugi tego nie robi - zachowuje sie tak jakby nie bylo tej czesci z php(a na tym musi byc wystawiona owa strona). Pliki w kazdym przypadku laduje najpierw do public_html, a potem do katalogu, w obu przypadkach jest tak samo..., a jednak jeden widzi a drugi nie sad.gif
Gdzie moze byc problem?


--------------------
lobuznica :)
Go to the top of the page
+Quote Post
Andree
post 27.12.2004, 00:30:52
Post #2





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 25.11.2003
Skąd: zewsząd

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


plik masz index.php?
  1. <a class=\"a\" href=\"index.php?element=1\">firma</a>&nbsp&nbsp
  2. <a class=\"a\" href=\"index.php?element=2\">oferta</a>&nbsp&nbsp
  3. <a class=\"a\" href=\"index.php?element=3\">galeria</a>&nbsp&nbsp
  4. <a class=\"a\" href=\"index.php?element=4\">kontakt</a>&nbsp&nbsp
  5. <a class=\"a\" href=\"index.php?element=5\">mapa witryny</a>
  6. <?php
  7. $element = isset($HTTP_GET_VARS[&#092;"element\"]) ? $HTTP_GET_VARS[\"element\"] : 1;
  8. switch($element)
  9. {
  10. case 1:
  11. include(&#092;"firma.html\");
  12. break;
  13. case 2:
  14. include(&#092;"oferta.html\");
  15. break;
  16. case 3:
  17. include(&#092;"galeria.html\");
  18. break;
  19. case 4:
  20. include(&#092;"kontakt.html\");
  21. break;
  22. case 5:
  23. include(&#092;"mapa.html\");
  24. break;
  25. default:
  26. include(&#092;"firma.html\");
  27. }
  28. ?>


--------------------
Go to the top of the page
+Quote Post
lobuznica
post 27.12.2004, 09:16:39
Post #3





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

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


nie, plik jest index.htm a wnim kawalek kodu php


--------------------
lobuznica :)
Go to the top of the page
+Quote Post
scanner
post 27.12.2004, 09:45:52
Post #4





Grupa: Zarząd
Postów: 3 503
Pomógł: 28
Dołączył: 17.10.2002
Skąd: Wrocław




Masz dwa wyjścia:
albo zmienić rozszerzenie pliku na .php
albo dodać rozszerzenie htm do listy parsowanych przez php w pliku httpd.conf

zalecam to pierwsze.


--------------------
scanner.info
Warto pamiętać: KISS, DRY
Go to the top of the page
+Quote Post
lobuznica
post 27.12.2004, 10:08:01
Post #5





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

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


Skorzystałam z pierwszej propozycji i działa smile.gif
Dziekuję smile.gif


--------------------
lobuznica :)
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 Wersja Lo-Fi Aktualny czas: 14.07.2025 - 11:41