note 58148 deleted from ref.session by felipe

From: Date: Sun, 30 Dec 2007 15:53:32 +0000
Subject: note 58148 deleted from ref.session by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-134303@lists.php.net to get a copy of this message
Note Submitter: Armando Scribano armando at scribano dot com dot ar ---- //PROTEC YOUR FILES . Double CHECK User validation login the basic operation login.php <?php //f_login save a session with user and pass $login = f_login($_REQUEST['usuario'],$_REQUEST['clave']); //f_login return a encrypted value if($login) { $_SESSION['login_enc']=$login; }else{ //incorrect user or password. } ?> protected.php <?php //Protected page //check //1 CHECK. user and password //return encrypted session $enc_user = f_encuser($_SESSION['usuario'], $_SESSION['clave']); //2 CHECK the last encrypted login and compare if($_SESSION['login_enc']==$enc_user){ // correct }else{ // incorrect } ?>

« previous php.notes (#134303) next »