Hi all
I use this script:
<?php session_start();
$idses=session_id();
require_once('Connections/iscritticon.php');
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
.
.
}
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1"))
{
$controllouserSQL = sprintf("SELECT * FROM info WHERE info.nickname = %s ;", GetSQLValueString($HTTP_POST_VARS['nicknamelog'], "text"));
$controllouserpassSQL = sprintf("SELECT * FROM info WHERE info.nickname = %s AND info.password = %s ;", GetSQLValueString($HTTP_POST_VARS['nicknamelog'], "text"),
GetSQLValueString($HTTP_POST_VARS['passwordlog'], "text"));
mysql_select_db($database_iscritticon, $iscritticon);
$Result2 = mysql_query($controllouserSQL, $iscritticon) or die(mysql_error());
$utente2= mysql_fetch_assoc($Result2);
mysql_free_result($Result2);
$Result3 = mysql_query($controllouserpassSQL, $iscritticon) or die(mysql_error());
$utentepas = mysql_fetch_assoc($Result3);
mysql_free_result($Result3);
if (($utente2["nickname"]==$HTTP_POST_VARS['nicknamelog']) && ($utentepas["password"]==$HTTP_POST_VARS['passwordlog']) &&
($HTTP_POST_VARS['nicknamelog']!="") && ($HTTP_POST_VARS['passwordlog']!=""))
{ $_SESSION["snickname"]=$HTTP_POST_VARS['nicknamelog'];
$_SESSION["spassword"]=$HTTP_POST_VARS['passwordlog'];
$_SESSION["sesid"]=$idses;
header (sprintf("Location: Avvisi.php?PHPSESSID=%s",$idses));
}
elseif (($utente2["nickname"]==$HTTP_POST_VARS['nicknamelog']) && ($utentepas["password"]!=$HTTP_POST_VARS['passwordlog']) &&
($HTTP_POST_VARS['nicknamelog']!=""))
{ header (sprintf("Location: errorpassword.php"));
}
else { header (sprintf("Location: errorutentenonr.php"));
}
}
?>
<div id="Layer3" style="position:absolute; width:200px; height:144px; z-index:3; left: 33px; top: 194px; background-color: #FFFFCC; layer-background-color: #FFFFCC; border: 1px none #000000;">
<p><span class="menusinistra"><a href="PageItaFirst.php?PHPSESSID=
<?php echo $idses; ?>"
class="menusinistra"><strong>Presentazione</strong></a><br>
<a href="PageItaRegFirst.php?PHPSESSID=
<?php echo $idses; ?>
">Registrazione</a></span></p>
<form action="<?php echo $editFormAction; ?>" method="POST" enctype="application/x-www-form-urlencoded" name="form1" onSubmit="MM_validateForm('nicknamelog','','R','passwordlog','','R');return document.MM_returnValue">
<p align="left">
<input type="submit" name="Submit" value="Login">
When i use session_start(), if i load the page with href in code html, it load the page but it is old .
When i reload with F5, the page is ok
If i want the page exactly, i must press F5( reload with browser)
Do anybody know Why?
Thank