Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [html/php] Walidacja vs <meta http-equiv='Refresh' content='
Jarod
post
Post #1





Grupa: Zarejestrowani
Postów: 1 190
Pomógł: 27
Dołączył: 23.04.2005

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


Mam następujący problem. Potrzebuję w skrypcie przekierować użytkownika na jakąś stronę. Jeśli mogę to używam header.

Ale czasami potrzebuję przekierować po upływie np 3 sekund. W tym celu zastosowałem coś takiego:

Kod
<meta http-equiv='Refresh' content='3; url=index.php' />


Niestety walidator się pluje;
Cytat
Line 21 column 481: document type does not allow element "meta" here.

...='Refresh' content='3; url=index.php' />

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).


Jak obejść ten problem?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




Zadam glupie pytanie. W jakim celu uzywasz ob_start() ? Bo kiedys u kogos to zobaczyles i pomyslales ze jest cool? (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)

Cytat
This function will turn output buffering on. While output buffering is active no output is sent from the script....To output what is stored in the internal buffer, use ob_end_flush().

Po polsku: dopoki nie wywolasz ob_end_flush nic ci do przegladarki nie poleci z kodu co generujesz

@siemakuba to bylo pytanie retoryczne (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)
Go to the top of the page
+Quote Post
Jarod
post
Post #3





Grupa: Zarejestrowani
Postów: 1 190
Pomógł: 27
Dołączył: 23.04.2005

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


Cytat(nospor @ 19.06.2006, 10:03 ) *
Zadam glupie pytanie. W jakim celu uzywasz ob_start() ? Bo kiedys u kogos to zobaczyles i pomyslales ze jest cool? (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)


Rozbrajasz mnie (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Używam ponieważ konfiguracja niektórych serwerów nie pozwala na poprawne działanie skryptów. Nie chce mi się później tego poprawiać jak ktoś mi powie że mu nie działa.

Cytat(nospor @ 19.06.2006, 10:03 ) *
Po polsku: dopoki nie wywolasz ob_end_flush nic ci do przegladarki nie poleci z kodu co generujesz


Czyli wychodzi na to, że spokojnie mogę dać w head do meta?
Go to the top of the page
+Quote Post

Posty w temacie


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: 6.10.2025 - 06:51