Hi !
I'd like to code a site in which you enter identifying yourself with an access code.
I am not able to use a session variable.
Here is the code :
$visiteurs_array = array(
"non_identifie" => array("visiteur inconnu", rand()),
"ticot" => array("Monsieur Ticot", "marivon")
);
// set default $visiteur to "non_identifie" :
$noms_array = array_keys($visiteurs_array);
$visiteur = $noms_array[0];
// if a visitor has yet been identified : reset $visiteur ( is it wrong here ? )
if( isset( $_SESSION["visiteur"] ) )
$visiteur = $_SESSION['visiteur'];
// from the login page, you can enter normaly the site :
if( isset($codax) )
foreach( $visiteurs_array as $cle=>$valeurs )
if( $codax == $valeurs[1] )
$visiteur = $cle;
// setting the session variable ( is it wrong here ? ) :
$_SESSION["visiteur"] = $visiteur;
See workplace at http://d.braschi-blondeau.chez-alice.fr/Bureau/bur_index.php
Thanx for your hand !