Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it
    Registrato dal
    Oct 2008
    Messaggi
    173

    PHP Andare a capo ad ogni link

    codice:
    <?php
       @include "config.php";?>
       <title><?php echo $title; ?></title>
       <link rel="stylesheet" type="text/css" href="website.css">
       </head>
       <body>
       <?php
         @include "top.php";
    
         if($query = @mysql_query("SELECT * FROM $assoc") or die (mysql_error()))
        {
            while ($fetch = @mysql_fetch_array($query) or die (mysql_error()))
            {
              $doc_nome = stripslashes($fetch['doc_nome']);
              $doc_url = stripslashes($fetch['doc_url']);
              $doc_link = stripslashes($fetch['doc_link']);
              ?>
                <td id="CONTENT">
              <?php
    
               echo"".$doc_nome."";
             }
     
          }
         @mysql_close();
    
     ?>
    ad ogni riga
    codice:
               echo"".$doc_nome."";
    vorrei andare a capo ma neanche con il comando
    non ci riesco

    Potete dirmi dov'è l'errore nella sintassi?
    Grazie in anticipo
    Massimiliano

  2. #2
    Moderatore di PHP L'avatar di Alhazred
    Registrato dal
    Oct 2003
    Messaggi
    12,448
    I link, anche se non andando a capo, riesci a stamparli?

    Comunque:
    echo "".$doc_nome."
    ";
    dovrebbe andarti a capo.

  3. #3
    Codice PHP:
    <?php
       
    include "config.php";
       
    ?>
       <title><?php echo $title?></title>
       <link rel="stylesheet" type="text/css" href="website.css">
       </head>
       <body>
       <?php
         
    include "top.php";
         echo 
    "<table>";
         if(
    $query =mysql_query("SELECT * FROM $assoc") or die (mysql_error()))
        {
            while (
    $fetch mysql_fetch_array($query) or die (mysql_error()))
            {
              
    $doc_nome stripslashes($fetch['doc_nome']);
              
    $doc_url stripslashes($fetch['doc_url']);
             
    $doc_link stripslashes($fetch['doc_link']);

               echo
    "<tr> <td id='CONTENT'>[url=".$doc_url."]".$doc_nome."[/url]</td></tr>";



             }

          }
        echo 
    "</table>";

         
    mysql_close();
         
    ?>
      </body>

  4. #4
    Utente di HTML.it
    Registrato dal
    Oct 2008
    Messaggi
    173
    grazie tante. funziona!!!
    Massimiliano

  5. #5
    Bene!il problema stava che nel while c'era solo un <td> aperto senza chiusura e con la mancanza dei <tr> e </tr>

  6. #6
    Utente di HTML.it
    Registrato dal
    Nov 2009
    Messaggi
    5
    Ricordo che puoi inserire anche tutto in un <div> e ti va a capo. Oppure, in un <ul>
    Time after time

  7. #7
    Per andare a capo ci son svariati modi....nel suo caso si tratta di dati entro <td></td>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.