Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it L'avatar di Japogi
    Registrato dal
    Feb 2004
    Messaggi
    190

    Come mettere delle ancore in un ciclo while????

    ki mi aiuta?

  2. #2
    Utente di HTML.it
    Registrato dal
    Jan 2002
    Messaggi
    428
    Ma le ancore sono di barchette o di navi? In quest'ultimo caso ti conviene avere un bel po di spazio ... :gren:

    Comunque magari posta qualche riga di codice

    ciao
    gnegno

  3. #3
    $numero = 1;
    while (...) {

    print "<a name="ancora$numero"></a>";
    $numero = $numero++;
    }

  4. #4
    Utente di HTML.it L'avatar di Japogi
    Registrato dal
    Feb 2004
    Messaggi
    190
    io ho questo problema: ho eseguito questo codice ke funziona solo con FireFox, mentre con il browser EI le ancore nn mi funzionano, come mai?

    $query = "SELECT DISTINCT regione FROM centri ORDER BY regione";
    $result = mysql_query($query);
    $i = 0;
    if($result)
    {
    while($row = mysql_fetch_array($result))
    {
    $regione = $row['regione'];
    ?>
    <tr>
    <td width='515' height="20" class="regione"><? print $regione?></td>
    </tr>
    <?
    }
    }
    ?>
    <tr>
    <td width='515'>
    <hr color="#FF6600" size="1" width="100%">
    </td>
    </tr>
    <tr>
    <td>
    <table width='100%' cellpadding='0' cellspacing='0' border='0'>
    <?
    include ("........");

    $query = "SELECT * FROM centri ORDER BY regione AND citta ASC";
    $result = mysql_query($query);
    $i = 0;
    $ankora = "";
    if($result)
    {
    while($row = mysql_fetch_array($result))
    {
    $idcentro = $row['idcentro'];
    $regione = $row['regione'];
    $citta = $row['citta'];
    $ospedale = $row['ospedale'];
    $reparto = $row['reparto'];
    $telefono = $row['telefono'];
    $i++;
    if($i == 1){
    ?>
    <tr>
    <?
    }
    ?>
    <td width="50%">
    <table width="100%">
    <?
    if ($ankora != strtolower($regione)){?>
    <a name="<?=strtolower($regione)?>"></a>
    <? ; $ankora = strtolower($regione); } ?>
    <tr>
    <td width="50%"><? print $citta ?></td>
    <td width="50%"></td>
    </tr>
    <tr>
    <td width="50%"><? print $ospedale ?></td>
    <td width="50%"><? print $telefono ?></td>
    </tr>
    <tr>
    <td colspan="2"><font size="1">*</font><? print $reparto ?></td>
    </tr>
    <tr><td></td></tr>
    </table>
    </td>
    <?
    if($i == 2){
    $i = 0;
    ?>
    </tr>
    <?
    }
    }
    if($i==1){
    ?>
    <td width="50%"></td></tr>
    <?
    }
    }
    mysql_free_result($result);
    mysql_close();
    ?>

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 © 2025 vBulletin Solutions, Inc. All rights reserved.