Partage
  • Partager sur Facebook
  • Partager sur Twitter

Code source sur une ligne ?

Sujet résolu
    18 août 2006 à 19:13:17

    Bonjour,
    J'ai fait une page toute simple PHP aujourd'hui, affichant un banal texte.
    Mais voilà quand je le teste, et bien le texte s'affiche pas dans le format que je veux.
    Je regarde le code source, bam, tout est sur une ligne, et y'a des balises qui sautent n'importe comment...
    (exemple echo '<p>blakodkz</p>'; va faire dans le code source '<p></p>blakodkz...' donc quelqu'un saurait-il d'où celà vient ?
    Code source de ma page :
    <?php
    require_once('kernel/functions.php');
    require_once('kernel/constantes.php');
    head_html();
    echo '<p><h1>ACWW Donations</h1><br /><br />';
    echo '<a href="logiciels/acwwd_setup.exe">Télécharger ACWW Donations <b>1.2</b></a></p>';
    foot_html();
    ?>


    PS : J'ai fait une page HTML pour comparer, et ça marche...
    HTML :
    <!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" xml:lang="fr" >
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" media="screen" type="text/css" title="Simple" href="kernel/simple.css" />
    <head><title>ACWW Donations</title></head>
    <body>
    <p><h1>ACWW Donations</h1><br /><br />
    <a href="logiciels/acwwd_setup.exe">Télécharger ACWW Donations <b>1.2</b></a></p>
    </body>
    </html>


    Edit : Excusez-moi, j'ai oublié d'ajouter sous quoi je travaille. Je code sous Notepad++ 3.8
    • Partager sur Facebook
    • Partager sur Twitter
    Anonyme
      18 août 2006 à 19:49:08

      Comme ca:
      <?php
      require_once('kernel/functions.php');
      require_once('kernel/constantes.php');
      head_html();
      echo '<p><h1>ACWW Donations</h1><br /><br />
      '
      ;
      echo '<a href="logiciels/acwwd_setup.exe">Télécharger ACWW Donations <b>1.2</b></a></p>
      '
      ;
      foot_html();
      ?>

      Ou comme ca:
      <?php
      require_once('kernel/functions.php');
      require_once('kernel/constantes.php');
      head_html();
      echo '<p><h1>ACWW Donations</h1><br /><br />'."\n";
      echo '<a href="logiciels/acwwd_setup.exe">Télécharger ACWW Donations <b>1.2</b></a></p>'."\n";
      foot_html();
      ?>


      edit: un seul antislash devant le n ( Zcode qui bug )
      • Partager sur Facebook
      • Partager sur Twitter
        18 août 2006 à 19:49:19

        rajoute des sauts de lignes \\n et tabulations \\t pour mettre en forme le code source.
        • Partager sur Facebook
        • Partager sur Twitter
          18 août 2006 à 19:55:14

          Merci ça marche impec' !
          • Partager sur Facebook
          • Partager sur Twitter

          Code source sur une ligne ?

          × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
          × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
          • Editeur
          • Markdown