From 45a8139acdc9a175f8f8e1536d42fa36bc57ff4c Mon Sep 17 00:00:00 2001 From: z0rglub Date: Sun, 27 Jul 2003 08:24:10 +0000 Subject: optional cookie identification git-svn-id: http://piwigo.org/svn/trunk@45 68402e56-0260-453c-a942-63ccdbb3a9ee --- identification.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'identification.php') diff --git a/identification.php b/identification.php index c88719d03..2c8901a05 100644 --- a/identification.php +++ b/identification.php @@ -18,10 +18,9 @@ //----------------------------------------------------------- personnal include include_once( "./include/init.inc.php" ); //-------------------------------------------------------------- identification -$error = array(); +$errors = array(); if ( isset( $_POST['login'] ) ) { - $i = 0; // retrieving the encrypted password of the login submitted $query = 'select password'; $query.= ' from '.PREFIX_TABLE.'users'; @@ -38,7 +37,7 @@ if ( isset( $_POST['login'] ) ) } else { - $error[$i++] = $lang['invalid_pwd']; + array_push( $errors, $lang['invalid_pwd'] ); } } //----------------------------------------------------- template initialization @@ -63,10 +62,9 @@ initialize_template(); if ( sizeof( $error ) != 0 ) { $vtp->addSession( $handle, 'errors' ); - for ( $i = 0; $i < sizeof( $error ); $i++ ) - { + foreach ( $errors as $error ) { $vtp->addSession( $handle, 'li' ); - $vtp->setVar( $handle, 'li.li', $error[$i] ); + $vtp->setVar( $handle, 'li.li', $error ); $vtp->closeSession( $handle, 'li' ); } $vtp->closeSession( $handle, 'errors' ); -- cgit v1.2.3