Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: php w XHTML'u
Forum PHP.pl > Forum > Po stronie przeglądarki > HTML \ XHTML
kapral
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>
bela
na samym poczatku daj
  1. <?php
  2. header('Content-Type: text/html');
  3. ?>


winksmiley.jpg
kapral
Niestety to nie pomogło
dr_bonzo
W jaki sposob wysylasz strone do walidatora? Podajac mu linkam, czy uploadujac plik? Czy plik przes przetworzony przez php?
kapral
poprzez upload z komputera
ARJ
jeśli uploadujesz plik do validatora zmień rozszerzenie z php na html. napewno zadziała.
kapral
ok dzięki wrzuciłem plik na serwer i validator się już nie czepia
dr_bonzo
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
a dlaczego musiałem dodać ten wpis, żeby zaczeło działać ?

header('Content-Type: text/html');
bela
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 biggrin.gif
Strus
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.
Invision Power Board © 2001-2025 Invision Power Services, Inc.