RE: [PHP] Login with Text Files

From: Date: Wed, 01 May 2002 06:05:16 +0000
Subject: RE: [PHP] Login with Text Files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-95472@lists.php.net to get a copy of this message
Why do you even bother? Just name your file SFISFWEF.html and have that as your password. If security isn't important, then don't use it at all. And please don't program anything for anyone else. ---John Holmes... > -----Original Message----- > From: Rodrigo [mailto:tagzero@tagzero.com] > Sent: Tuesday, April 30, 2002 7:54 PM > To: php-general@lists.php.net > Subject: [PHP] Login with Text Files > > Hi guys, I'm trying the following code and the problem is that I always > get the denied page... > What I'm trying here is to make a login thru a text file. The logins are > in one file named login.txt, and the passwords are in the file called > pass.txt . I need Help, I can't seem to get thru here and I need it just > like that, cause the other option would be to use my server database > which uses a PHPMYADMIN that I don't know anything about. I can't seem > to make it work, so let's stay with the text files, cause I don't need > it to be safe ( security sound ). The code goes after this message. > Thanks to all. > Rodrigo. > > > > <?php > $logins = File('login.txt'); > $login_cont = count($logins); > $login_digitado2 = $login_digitado; > for ($cont=0;$cont<$login_cont;$cont++) > { > if($logins[$cont] == $login_digitado2) > { > $login_indice = $cont+1; > } > } > > $password = File('pass.txt'); > if ($password[$login_indice] == $password_digitada) > { > header('Location:http://www.domain.com/restricted/restricted.htm'); > } > else > > header('Location:http://www.domain.com/denied.htm'); > ?>

« previous php.general (#95472) next »