kapral
5.03.2005, 17:42:12
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>
na samym poczatku daj
<?php
header('Content-Type: text/html'); ?>
kapral
5.03.2005, 17:53:15
Niestety to nie pomogło
dr_bonzo
5.03.2005, 18:21:17
W jaki sposob wysylasz strone do walidatora? Podajac mu linkam, czy uploadujac plik? Czy plik przes przetworzony przez php?
kapral
5.03.2005, 18:22:13
poprzez upload z komputera
jeśli uploadujesz plik do validatora zmień rozszerzenie z php na html. napewno zadziała.
kapral
5.03.2005, 18:25:20
ok dzięki wrzuciłem plik na serwer i validator się już nie czepia
dr_bonzo
5.03.2005, 19:23:35
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).
kapral
5.03.2005, 19:35:55
a dlaczego musiałem dodać ten wpis, żeby zaczeło działać ?
header('Content-Type: text/html');
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
Strus
5.03.2005, 22:50:38
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
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę
kliknij tutaj.