per semplificare il tutto ho cambiato user in ID
faccio cosi in users.class.php
codice:} // verifica login public function get_id(){ return $_SESSION['auth']; }
e cosi nella pagina dei risultati
codice:<?php session_start(); require_once('lib/Users.class.php'); $login = New Users; ?> <html> <head> <link rel="stylesheet" href="css/style.css" type="text/css" /> </head> <body> <body> <?php if($login->is_logged()) : ?> <div id="contenuti_protetti"> <?php /* Visualizza tutti i dati della tabella 'players' */ // connessione al database include('connect-db.php'); $id = $login->get_id(); // ottiene i risultati dal database $result = mysql_query("SELECT * FROM players where id=$id") or die(mysql_error()); // visualizza i dati in tabella echo "<table border='1' cellpadding='10'>"; echo "<tr> <th>ID cliente</th> <th>Spedizione</th> <th>Data Spedizione</th> <th>Colli</th> <th>Peso</th> <th>Destinatario</th> <th>Località </th> <th>Contrassegno</th> <th>Ora e Data inserimento</th> <th>Eventuali comunicazioni</th> <th>Dettaglio</th> </tr>"; // loop tra i risultati della query del database, visualizzandoli in tabella while($row = mysql_fetch_array( $result )) { // emissione del contenuto di ogni riga in una tabella echo "<tr>"; echo '<td>' . $row['id'] . '</td>'; echo '<td>' . $row['id_sepf'] . '</td>'; echo '<td>' . $row['data'] . '</td>'; echo '<td>' . $row['colli'] . '</td>'; echo '<td>' . $row['peso'] . '</td>'; echo '<td>' . $row['riferimentodest'] . '</td>'; echo '<td>' . $row['localita'] . '</td>'; echo '<td>' . $row['contrassegno'] . '</td>'; echo '<td>' . $row['ora_data'] . '</td>'; echo '<td>' . $row['comunicazioni'] . '</td>'; echo '<td><a href="dettaglio.php?id=' . $row['id'] . '">Dettaglio</a></td>'; echo "</tr>"; } // chiude la tabella> echo "</table>"; ?> </div> <?php endif; ?> </div> </body> </html>
nulla pagina bianca

Rispondi quotando

