Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> php w XHTML'u
kapral
post
Post #1





Grupa: Zarejestrowani
Postów: 208
Pomógł: 0
Dołączył: 5.03.2005

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


Powiedzcie mi jak to jest z tym XHTML'em.
Chcę na stronie zgodnej z XHTML 1.1 zamieścić skrypt php. I tu jest problem ponieważ stronę muszę zapisać jako *.php aby skrypt się wykonał i wtedy validator wypisuję coś takiego:

Sorry, I am unable to validate this document because its content type is application/octet-stream, which is not currently supported by this service.

The Content-Type field is sent by your web server (or web browser if you use the file upload interface) and depends on its configuration. Commonly, web servers will have a mapping of filename extensions (such as ".html") to MIME Content-Type values (such as text/html).

That you recieved this message can mean that your server is not configured correctly, that your file does not have the correct filename extension, or that you are attempting to validate a file type that we do not support yet. In the latter case you should let us know that you need us to support that content type (please include all relevant details, including the URL to the standards document defining the content type) using the instructions on the Feedback Page.


Oto początek mojej strony, powiedzcie gdzie tkwi problem:

<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-2\"?>"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">
<head>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 10)
bela
post
Post #2


Administrator PHPedia.pl


Grupa: Developerzy
Postów: 1 102
Pomógł: 2
Dołączył: 14.09.2003

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


na samym poczatku daj
  1. <?php
  2. header('Content-Type: text/html');
  3. ?>


(IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
kapral
post
Post #3





Grupa: Zarejestrowani
Postów: 208
Pomógł: 0
Dołączył: 5.03.2005

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


Niestety to nie pomogło
Go to the top of the page
+Quote Post
dr_bonzo
post
Post #4





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

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


W jaki sposob wysylasz strone do walidatora? Podajac mu linkam, czy uploadujac plik? Czy plik przes przetworzony przez php?
Go to the top of the page
+Quote Post
kapral
post
Post #5





Grupa: Zarejestrowani
Postów: 208
Pomógł: 0
Dołączył: 5.03.2005

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


poprzez upload z komputera
Go to the top of the page
+Quote Post
ARJ
post
Post #6





Grupa: Zarejestrowani
Postów: 453
Pomógł: 22
Dołączył: 20.09.2004
Skąd: Kraków - NH -

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


jeśli uploadujesz plik do validatora zmień rozszerzenie z php na html. napewno zadziała.
Go to the top of the page
+Quote Post
kapral
post
Post #7





Grupa: Zarejestrowani
Postów: 208
Pomógł: 0
Dołączył: 5.03.2005

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


ok dzięki wrzuciłem plik na serwer i validator się już nie czepia
Go to the top of the page
+Quote Post
dr_bonzo
post
Post #8





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

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


Czyli wysylales mu plik *.php przed przepuszczeniem go przez serwer? Wtedy validator musi spradzac KOD php a nie XHTML.
Albo wrzuc plik na serwer (tak jak zrobiles) albo otworz go u siebie na serwerze i z przeglladarki zapisz go na dysk i dopiero to wyslij (uploaduj).
Go to the top of the page
+Quote Post
kapral
post
Post #9





Grupa: Zarejestrowani
Postów: 208
Pomógł: 0
Dołączył: 5.03.2005

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


a dlaczego musiałem dodać ten wpis, żeby zaczeło działać ?

header('Content-Type: text/html');
Go to the top of the page
+Quote Post
bela
post
Post #10


Administrator PHPedia.pl


Grupa: Developerzy
Postów: 1 102
Pomógł: 2
Dołączył: 14.09.2003

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


Cytat
The Content-Type field is sent by your web server (or web browser if you use the file upload interface) and depends on its configuration. Commonly, web servers will have a mapping of filename extensions (such as ".html") to MIME Content-Type values (such as text/html).


Przecież jest napisane (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)
Go to the top of the page
+Quote Post
Strus
post
Post #11





Grupa: Zarejestrowani
Postów: 184
Pomógł: 0
Dołączył: 19.01.2005
Skąd: Bochnia

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


Cytat(kapral @ 2005-03-05 19:35:55)
a dlaczego musiałem dodać ten wpis, żeby zaczeło działać ?

header('Content-Type: text/html');

Jeżeli piszesz w XHTMLu 1.1 to ma być tak:
Kod
header('Content-Type: application/xhtml+xml');


w starszych wersjach możesz dać text/html
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: 22.08.2025 - 17:52