questo è il codice da dove l'utente,dopo essersi loggato, sceglie :
<?php
session_start();
require_once 'connessione.php';
if(!isset($_POST['indietro']))
{
$db = new connessione();
$db->connetti('utenti');
$db->selezione_dipendente(@$_POST['user'],sha1(@$_POST['pass']),'dipendente');
}
if((isset($_SESSION['nomeaccesso']) && isset($_SESSION['cognomeaccesso'])) )
{
?>
<h1> Uffici </h1>
<table>
<tr>
<form action = "ufficio_anagrafe.php" method = post>
<input type = "submit" name = "anagrafe" value = "anagrafe"/> </form>
<form action = "dip_tecnico.php" method = post>
<input type = "submit" name = "tecnico" value = "tecnico"/> </form>
<form action = "dip_ragioneria.php" method = post>
<input type = "submit" name = "ragioneria" value = "tributi"/> </form>
<form action = "ufficio_suap.php" method = post>
<input type = "submit" name = "suap" value = "suap"/> </form>
</tr>
</table>
<h1>Utenti</h1>
<hr/>
<table>
<tr>
<td><h2>Registrazione Utenti</h2></td>
<td><h2>Elenco Utenti</h2></td>
</tr>
<tr>
<td><form action = "elenco_temporanei.php" method = post>
<input type = "submit" name = "verifica" value = "verifica"/> </form>
<form action = "dipendente_registra.php" method = post>
<input type = "submit" name = "registra" value = "registra"/> </form>
</td>
<td><form action = "elenco_registrati.php" method = post>
<input type = "submit" name = "visualizza" value = "visualizza"/> </form>
</td>
</tr>
</table>
<table>
....................
dopo, premo il tasto verifica che apre la pagina elenco_temporanei.php, se la tabella che dovrebbe visualizzare è vuota devo farlo ritornare alla pagina precedente senza perdere i dati d'accesso.
<?php
session_start();
require_once 'connessione.php';
$db = new connessione();
$db->connetti('utenti');
$tabella = $db->visualizza('utente_temp');
if($tabella == "0")
{
echo'<script type = "text/javascript">
alert(\'AVVISO, nessuna richiesta di registrazione\');
</script>';
}
else......