<?php
if(!isset($_SESSION)){
session_start ();
}
if(!isset($_SESSION['conta'])){
$_SESSION['conta']=0;
}else{
if($_POST['scelta']=="continua" || $_POST['scelta']==NULL){
$_SESSION['conta']=(int)$_SESSION['conta']+1;
}elseif($_POST['scelta']=="resetta"){
$_POST['scelta']="continua";
$_SESSION['conta']=0;
}
}
echo "valore raggiunto= ".$_SESSION['conta'];
?>
<p> </p>
<p> </p>
<form name="form1" method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
<p>continua
<input name="scelta" type="radio" value="continua" checked>
resetta
<input name="scelta" type="radio" value="resetta">
</p>
<p>
<input name="resetta" type="submit" id="resetta" value="go">
</p>
</form>