Salve ,allora dovrei inserire una sessione su questo file...Perchè siccome quando entro all'interno c'è una tabella dove stanno gli utenti che si iscrivono ed ho la possibilità di cancellare chi voglio solo che quando elimino esce:
Dati eliminati con successo,TORNA INDIETRO...Quando TORNO INDIETRO mi caccia Fuori come se fossi endrato tramite indirizzo o sbagliato il login potete aiutatmi penso bisogni inserire una Sessione...
ECCO il codice tabella.php
<?php
if ($_POST['password'] != "admin") die("Non hai i requisiti per accedere <a href=\"login.html\">Effettua il login!</a>");
?>
<style type="text/css">
<!--
.Stile1 {font-family: "Arial Narrow"}
-->
</style>
<p class="Stile1">Pannello di controllo: Gestione utenti </p>
<?php
$db_host="localhost";
$db_name="my_fantaminei";
$db_user="fantaminei";
$db_password="";
mysql_connect($db_host,$db_user,$db_password) or die("errore connessione");
mysql_select_db($db_name) or die("errore database");
$sql = "SELECT * FROM utenti ORDER BY nome";
$result = mysql_query($sql);
?>
<form action="cancella.php" method="post" name="form_delete">
<table border="1">
<tr>
<th>ID</th>
<th>Nome</th>
<th>Cognome</th>
<th>Indirizzo</th>
<th>Cap</th>
<th>Citta</th>
<th>Telefono</th>
<th>Email</th>
<th>Nato</th>
<th>Cancella</th>
</tr>
<?php
$count = mysql_num_rows($result);
for ($i=0; $i<$count; $i++){
$row = mysql_fetch_array($result);
?>
<tr>
<td><?php echo $row['id']; ?></td>
<td><?php echo $row['nome']; ?></td>
<td><?php echo $row['cognome']; ?></td>
<td><?php echo $row['indirizzo']; ?></td>
<td><?php echo $row['cap']; ?></td>
<td><?php echo $row['citta']; ?></td>
<td><?php echo $row['telefono']; ?></td>
<td><?php echo $row['email']; ?></td>
<td><?php echo $row['nato']; ?></td>
<td style="text-align:center;"><input type="checkbox" name="cancella_<?php echo $i;?>" value="<?php echo $row['id']; ?>"></td>
</tr><?php }?>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td style="text-align:center;"><input type="hidden" name="totale" value="<?php echo $count; ?>"><input type="submit" value="Cancella"></td>
</table>
</form>
<?php
mysql_close();
?>