esatto!!! io ho le pagine login.php e logout.php per fare la login/logout, come funzionano lo sappiamo tutti quanti: controllo dell'utente sul db, set di variabili di sessione e reindirizzo sulla pagina che si stava visitando; il tutto funziona in tutte le pagine (il form per fare login si trova in tutte le pagine). Il problema si presenta sulla pagina del guestbook, quando faccio login/logout da questa pagina, la login/logout funziona ma il reindirizzamento sulla pagina guestbook.php mi da pagina scaduta (guestbook.php ha un meccanismo per dividere i messaggi in sottopagine)
ora posto un frammento di guestbook.php
<?php
$strSQL = "SELECT id_guestbook FROM `guestbook`";
$result = mysql_query($strSQL);
$rows = mysql_num_rows($result);
$page = @$_POST['selezione'];
$pages=$rows/3;
if($page==""){
$start=0;
}
else{
$start=$page*3;
}
$strSQL1 = "SELECT * FROM `guestbook` LIMIT $start,3";
$result1 = mysql_query($strSQL1);
?>
<table width="100%" border="0">
<tr>
<td valign="top" width="40%">
<table>
<tr>
<td>
<fieldset style="width:270px">
<legend style="color:#e2c3a5; font-size:14">Login</legend>
<form method="post" action="verifica_login.php">
<input type="text" name="username"><font style="color:#e2c3a5; font-size:14">Username</font></input>
<input type="password" name="password"><font style="color:#e2c3a5; font-size:14">Password</font></input>
<input type="submit" value="invia" <?php echo $dis ?> ></input>
<input type="reset" value="cancella"></input>
</form>
<?php
if(!isset($_SESSION['logged'])){
echo "<p class=\"reg\"><a href=\"register.php\">registrati</a></p>";
}
?>
</fieldset>
</td>
</tr>
<tr>
<td>1</td>
</tr>
</table>
</td>
<td valign="top">
<table>
<tr>
<td>
<?php
while($row = mysql_fetch_row($result1)){
$a = formatta($row[3]);
echo "<h3>$a</h3>";
echo "<h3>$row[1]</h3>";
echo "
$row[2]</p>";
}
?>
</td>
</tr>
<tr>
<td>
<form name="form" method="post" action="guestbook.php">
<select name="selezione" onchange="funzione()">
<?php
for($j=0; $j<$pages; $j++){
$stamp=$j+1;
if($j==$page){
echo "<option value=\"$j\" selected>$stamp</option>";
}
else{
echo "<option value=\"$j\">$stamp</option>";
}
}
?>
</select>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>