lundi 11 juillet 2016

change random number when echo

i have a problem with function in . i set random number on a $_SESSION and in other place echo this. but every time i echo $_SESSION, value on it is changed. my code in page1:

session_start();
$_SESSION['y'] = rand(1,100);
echo $_SESSION['y'];

and in other page2 i write this:

session_start();
echo $_SESSION['y'];

how can i solve it?




Aucun commentaire:

Enregistrer un commentaire