IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

HTML Discussion :

Erreur avec du PHP


Sujet :

HTML

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Inscrit en
    Avril 2009
    Messages
    42
    Détails du profil
    Informations forums :
    Inscription : Avril 2009
    Messages : 42
    Par défaut Erreur avec du PHP
    Bonjour a tous,


    voila je voudrais avoir une explication a mon problème, j'ai créé un fichier index.xhtml et je suis aller voir le validator w3c et la pas d'erreur.
    Je me dis aller essayons simplement en chnageant l'extension donc je me dis index.html, toujours pas d'erreur.
    La dans mon fichier il y a du code php alors je me dis je dois mettre mon extension en php et donc je m'est index.php et la j'ai des erreurs et exactement 10.


    Merci pour vos réponses.

  2. #2
    Modérateur
    Avatar de Bisûnûrs
    Profil pro
    Développeur Web
    Inscrit en
    Janvier 2004
    Messages
    9 931
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Janvier 2004
    Messages : 9 931
    Par défaut
    Le validateur n'interprète pas le code PHP si tu lui fournis le fichier par upload. Il faut lui donner une URL dans ce cas-là.

  3. #3
    Membre averti
    Inscrit en
    Avril 2009
    Messages
    42
    Détails du profil
    Informations forums :
    Inscription : Avril 2009
    Messages : 42
    Par défaut
    Le soucis les erreurs ne viennes pas directement de mes code php, donc tout ce qui est <?PHP ?> n'est pas mis en erreur mais par exemple:

    Line 19, Column 9: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
    <li><a href="http://www.domaine.com"> </a></li>


    il me met une erreur ou j'ai mis le rouge mais si je renomme en xhtml pas d'erreur.

  4. #4
    Membre Expert Avatar de HiRoN
    Homme Profil pro
    Développeur Web
    Inscrit en
    Août 2007
    Messages
    2 035
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Août 2007
    Messages : 2 035
    Par défaut
    Bonjour,
    Citation Envoyé par ptiteuf Voir le message
    Line 19, Column 9: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
    <li><a href="http://www.domaine.com"> </a></li>
    L'erreur cité est dû à un mauvais placement de ta liste ou l'oubli de la balise <ul> en amont (bref erreur de construction).
    Avoir le code encadrant l'erreur permettrait de mieux t'aider...
    Pensez à utiliser les ressources disponibles en Dev. Web :
    (x)HTML : Cours (X)HTML / FAQ (X)HTML
    CSS : Cours CSS / FAQ CSS / Galerie CSS
    Javascript : Cours / FAQ / Sources
    Mon site : Développeur Web Freelance

  5. #5
    Membre averti
    Inscrit en
    Avril 2009
    Messages
    42
    Détails du profil
    Informations forums :
    Inscription : Avril 2009
    Messages : 42
    Par défaut
    voici tout le code de mon fichier actuellement

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="robots" content="all" />
    <link rel="shortcut icon" type="image/x-icon" href="http://www.domaine.com/favicon.ico" />
    <title>domaine.com</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    	<div id="main">
    		<div id="header">
    			<img src="/images/header_background.jpg" alt="domaine" title="domaine" width="700" height="141" />
    			<div id="casemenu">
    				<ul id="menu">
                    <?php
    define('SITE_URL', 'http://www.domaine.com/');
    if (isset($_GET['lang'])) {
        define('i18n', $_GET['lang']);
    } else {
        define('i18n', substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2));
    }
     
    include('i18n/'.i18n.'.inc.php');
    ?>
    					<li><a href="http://www.domaine.com"> <?php echo $LANG[i18n]['home']; ?> </a></li>
    					<li><a href="http://www.domaine.com"> <?php echo $LANG[i18n]['directory']; ?> </a></li>
    					<li><a href="http://www.domaine.com"> <?php echo $LANG[i18n]['board']; ?> </a></li>
    					<li><a href="http://www.domaine.com"> <?php echo $LANG[i18n]['blog']; ?> </a></li>
    					<li><a href="http://www.domaine.com"> <?php echo $LANG[i18n]['events']; ?> </a></li>
    					<li><a href="http://www.domaine.com"> <?php echo $LANG[i18n]['chat']; ?> </a></li>
    					<li><a href="http://www.domaine.com"> <?php echo $LANG[i18n]['meeting']; ?> </a></li>  
                        <li><a href="http://www.domaine.com"> <?php echo $LANG[i18n]['Gallery']; ?> </a></li>                        
    				</ul>
    			</div>
    		</div>
    		<div id="page">
            <div id="sidebar">
            <img src="/images/lecteur.jpg" alt="QGRadio" title="QGRadio" />
           <?php        echo '<br />';
                            ?>
    <?php        echo '<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />';
                            ?>
            </div>
            <div id="content">
     
                 <img src="/images/titeuf6.png" align="left" vspace="5" hspace="3">
    <?php       echo '<font color="#E80000">'.$LANG[i18n]['edito1'] .'</font>';
                            ?>
    <?php       echo '<br /><br />';
                            ?>
     
     
     
     
    		</div>
            	</div>
    		<div id="footer">
    			<p>
    				<?php 
                    echo '<p>' .'Copyright domaine.com &copy; 2007-'. date('Y'). '</p>';   
                            ?> 
    			</p>
    	  </div>
    </div>
    </body>
    </html>
    Meme en faissant ceci

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="robots" content="all" />
    <link rel="shortcut icon" type="image/x-icon" href="http://www.domaine.com/favicon.ico" />
    <title>domaine.com</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    	<div id="main">
    		<div id="header">
    			<img src="/images/header_background.jpg" alt="domaine" title="domaine" width="700" height="141" />
    			<div id="casemenu">
    				<ul id="menu">
                    <?php
    define('SITE_URL', 'http://www.domaine.com/');
    if (isset($_GET['lang'])) {
        define('i18n', $_GET['lang']);
    } else {
        define('i18n', substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2));
    }
     
    include('i18n/'.i18n.'.inc.php');
    ?>
    					<li><a href="http://www.domaine.com"> accueil </a></li>
    					<li><a href="http://www.domaine.com"> annuaire </a></li>
    					<li><a href="http://www.domaine.com"> forum</a></li>
    					<li><a href="http://www.domaine.com"> blog </a></li>
    					<li><a href="http://www.domaine.com"> evenement </a></li>
    					<li><a href="http://www.domaine.com"> tchat </a></li>
    					<li><a href="http://www.domaine.com"> rencontre </a></li>  
                        <li><a href="http://www.domaine.com"> galerie </a></li>                        
    				</ul>
    			</div>
    		</div>
    		<div id="page">
            <div id="sidebar">
            <img src="/images/lecteur.jpg" alt="QGRadio" title="QGRadio" />
           <?php        echo '<br />';
                            ?>
    <?php        echo '<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />';
                            ?>
            </div>
            <div id="content">
     
                 <img src="/images/titeuf6.png" align="left" vspace="5" hspace="3">
    <?php       echo '<font color="#E80000">'.$LANG[i18n]['edito1'] .'</font>';
                            ?>
    <?php       echo '<br /><br />';
                            ?>
     
     
     
     
    		</div>
            	</div>
    		<div id="footer">
    			<p>
    				<?php 
                    echo '<p>' .'Copyright domaine.com &copy; 2007-'. date('Y'). '</p>';   
                            ?> 
    			</p>
    	  </div>
    </div>
    </body>
    </html>
    j'avais oublier de mettre les 10 erreurs que j'ai
    Line 15, Column 22: document type does not allow element "br" here; assuming missing "li" start-tag
    <br />✉
    Line 19, Column 9: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
    <li><a href="http://www.domaine.com"> </a></li>✉
    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Line 20, Column 9: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
    <li><a href="http://www.domaine.com"> </a></li>✉
    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Line 21, Column 9: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
    <li><a href="http://www.domaine.com"> </a></li>✉
    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Line 22, Column 9: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
    <li><a href="http://www.domaine.com"> </a></li>✉
    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Line 23, Column 9: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
    <li><a href="http://www.domaine.com"> </a></li>✉
    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Line 24, Column 9: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
    <li><a href="http://www.domaine.com"> </a></li>✉
    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Line 25, Column 9: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
    <li><a href="http://www.domaine.com"> </a></li> ✉
    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Line 26, Column 24: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
    <li><a href="http://www.domaine.com"> </a></li> ✉
    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Line 27, Column 9: end tag for "li" omitted, but OMITTAG NO was specified
    </ul>✉
    You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
    Line 15, Column 16: start tag was here
    <br />

  6. #6
    Membre éprouvé
    Profil pro
    Inscrit en
    Avril 2009
    Messages
    126
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2009
    Messages : 126
    Par défaut
    T'as une option dans le valideur pour te montrer la source, à la fin de la validation, sert-en pour pouvoir plus facilement voir d'où vient l'erreur et donne directement le lien de validation, ça ira plus vite

Discussions similaires

  1. [MySQL] Erreur d'insertion avec script PHP
    Par Anthodev dans le forum PHP & Base de données
    Réponses: 2
    Dernier message: 20/09/2008, 15h00
  2. erreur javascript pour modifier select avec tableau PHP
    Par omdafer dans le forum Général JavaScript
    Réponses: 9
    Dernier message: 24/03/2008, 12h27
  3. Message d'erreur avec Easy PHP
    Par LN69 dans le forum Langage
    Réponses: 5
    Dernier message: 10/02/2008, 21h53
  4. [EasyPHP] Erreur avec Easy-Php
    Par breizhgen dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 1
    Dernier message: 09/08/2007, 10h14
  5. [Forum] Des erreurs avec tous les scripts PHP
    Par sensoo dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 12
    Dernier message: 25/04/2006, 18h41

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo