Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [html][php] PHP W HTML'u
MnicH.
post 5.07.2007, 08:37:15
Post #1





Grupa: Zarejestrowani
Postów: 134
Pomógł: 4
Dołączył: 16.02.2007
Skąd: Leszno

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


Witam!
Widziałem na pewnych stronach ze maja swoj portal w html a w nim php.
No i jak umiescilem go do html'u to nie odczytuje go!!
Jak umieśćić php w html'u?questionmark.gif


--------------------
"This isn't Miami..., This isn't Music! This is power!!"
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 11)
uli
post 5.07.2007, 08:51:36
Post #2





Grupa: Zarejestrowani
Postów: 318
Pomógł: 6
Dołączył: 27.01.2005

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


A masz serwer z obsługą php ? smile.gif

generalnie kod zamykasz w znacznikach:

  1. <?php
  2.  
  3. // kod php
  4.  
  5. ?>


Ten post edytował uli 5.07.2007, 08:52:15


--------------------
Prawo Wylera:
Nie ma rzeczy niemożliwych dla kogoś, kto nie musi ich zrobić sam.
Go to the top of the page
+Quote Post
MnicH.
post 5.07.2007, 08:55:02
Post #3





Grupa: Zarejestrowani
Postów: 134
Pomógł: 4
Dołączył: 16.02.2007
Skąd: Leszno

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


ma obsluge php


--------------------
"This isn't Miami..., This isn't Music! This is power!!"
Go to the top of the page
+Quote Post
qwaq
post 5.07.2007, 13:11:02
Post #4





Grupa: Zarejestrowani
Postów: 162
Pomógł: 1
Dołączył: 15.05.2007
Skąd: Łódź

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


proponuje a iframe wrzucic


--------------------
Chcę kobietę!!! Cierpliwą i wyrozumiałą jak stado bydła przed dojeniem.....

Życie jest jak papier toaletowy-długie, szare i do dupy, ale na szczęście czasem pachnie rumiankiem


wynajmę mieszkanie?
Go to the top of the page
+Quote Post
ArniPL
post 5.07.2007, 14:38:01
Post #5





Grupa: Zarejestrowani
Postów: 30
Pomógł: 0
Dołączył: 19.11.2006

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


Pewnie chodzi o to, że strona z rozszerzeniem .html ma być parsowana jako PHP. W tym wypadku musisz w konfiguracji serwera dodać rozszerzenie .html jako typ PHP. Najłatwiej to zrobić poprzez plik .htaccess (musisz w głównym katalogu strony umieścić plik o nazwie ".htaccess" w treści wpisując:
Kod
Action application/x-httpd-php5 "/cgi-sys/php5"
AddType application/x-httpd-php5 .html

Pamiętaj żeby zostawić jedną pustą linię na końcu.


--------------------
Sprzęt: Athlon64 3800+, 2GB RAM, Radeon X850
Oprogramowanie: WinXP/Ubuntu 7.10(Gnome+Beryl), Notepad2, Opera 9.50/Firefox 3, MirandaIM 0.7.3
Go to the top of the page
+Quote Post
MnicH.
post 5.07.2007, 15:10:47
Post #6





Grupa: Zarejestrowani
Postów: 134
Pomógł: 4
Dołączył: 16.02.2007
Skąd: Leszno

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


a działa to na hostingu CBA.PL
Bo tam niema takiego pliku!!
A jak go dodalem to wywala blad:
Forbidden

You don't have permission to access /index.html on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

questionmark.gif?


--------------------
"This isn't Miami..., This isn't Music! This is power!!"
Go to the top of the page
+Quote Post
ArniPL
post 5.07.2007, 15:29:05
Post #7





Grupa: Zarejestrowani
Postów: 30
Pomógł: 0
Dołączył: 19.11.2006

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


Na cba.pl pisze że jest dostęp do .htaccess i php5 więc powinno działać. Nie mam pojęcia czemu Ci 403 wywala... W .htaccess masz tylko to co napisałem czy coś jeszcze?


--------------------
Sprzęt: Athlon64 3800+, 2GB RAM, Radeon X850
Oprogramowanie: WinXP/Ubuntu 7.10(Gnome+Beryl), Notepad2, Opera 9.50/Firefox 3, MirandaIM 0.7.3
Go to the top of the page
+Quote Post
mrjozo
post 5.07.2007, 16:04:25
Post #8





Grupa: Zarejestrowani
Postów: 142
Pomógł: 3
Dołączył: 27.06.2007

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


Myślę, że lepiej użyć do tego modułu rewrite...

Spróbuj wpisać taki kod do .htacces

Kod
<IfModule mod_rewrite.c>
  RewriteEngine on

RewriteRule ^(.*)\.html/?(.*)/?$ $1.php/$2 [L,QSA]

</IfModule>


--------------------
W chwili wolnego zapraszam na gry Dla każdego coś się znajdzie;)
Go to the top of the page
+Quote Post
MnicH.
post 5.07.2007, 16:58:48
Post #9





Grupa: Zarejestrowani
Postów: 134
Pomógł: 4
Dołączył: 16.02.2007
Skąd: Leszno

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


mrjozo Niestety ale ten sam błąd!!
ArniPL Mam wszystko tak jak napisales i ta pusta linijke

na ten plik mam ustawione prawa 600questionmark.gif


--------------------
"This isn't Miami..., This isn't Music! This is power!!"
Go to the top of the page
+Quote Post
mrjozo
post 5.07.2007, 17:06:27
Post #10





Grupa: Zarejestrowani
Postów: 142
Pomógł: 3
Dołączył: 27.06.2007

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


Prawa 644


--------------------
W chwili wolnego zapraszam na gry Dla każdego coś się znajdzie;)
Go to the top of the page
+Quote Post
MnicH.
post 5.07.2007, 18:47:15
Post #11





Grupa: Zarejestrowani
Postów: 134
Pomógł: 4
Dołączył: 16.02.2007
Skąd: Leszno

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


teraz calkiem inny

jak ustawilem prawa na 644 to wywala mi taki blad:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.


--------------------
"This isn't Miami..., This isn't Music! This is power!!"
Go to the top of the page
+Quote Post
ArniPL
post 5.07.2007, 22:14:36
Post #12





Grupa: Zarejestrowani
Postów: 30
Pomógł: 0
Dołączył: 19.11.2006

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


Taki błąd to rozumiem. smile.gif Najprawdopodobniej problem tkwi w pliku .htaccess Zmień go na:
Kod
Action application/x-httpd-php "/cgi-sys/php"
AddType application/x-httpd-php .html

Być może serwer traktuje typ MIME application/x-httpd-php jako php5 a typu application/x-httpd-php5 wogóle nie ma wpisanego. Prawdopodobnie stąd ten błąd.

Ten post edytował ArniPL 5.07.2007, 22:14:55


--------------------
Sprzęt: Athlon64 3800+, 2GB RAM, Radeon X850
Oprogramowanie: WinXP/Ubuntu 7.10(Gnome+Beryl), Notepad2, Opera 9.50/Firefox 3, MirandaIM 0.7.3
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: 19.07.2025 - 09:53