I think this will work :

foreach $i(@access) {
  chomp $i;
  ($un,$pw) = split(/\|/, $i);
  $username = $FORM{'username'};
  $password = $FORM{'password'};

  if (($username ne $un) || ($password ne $pw)) {
    print <<NoPass; (block of html for invalid username/passwordscreen)
    NoPass
  }
  else {
    print <<YesPass; (block of html for Account manager screen)
    YesPass
  } 
} # End foreach

Regs David
---------------

>    I'm starting to make a perl/cgi/html based multi-player game called 3MF (Massive 
>Multiplayer Medieval Frolic).  So far I've made an account creation screen that 
>writes the data to two flat file db's one of them holds the usernames & passwords, 
>while the other holds all the user information.
>     Now I'm working on the login screen but I've run into some problems.  It only 
>lets the last user account I create gain access.  For any others it sends them to the 
>invalid username and password screen I created.  
>    Here is the code I'm using right now.  I open up the file with the usernames and 
>passwords and throw it all into @access and then do this
> 
> foreach $i (@access) {
> chomp($i);
> ($un,$pw) =
> split(/\|/,$i);
> }
> 
> $username = $FORM{'username'};
> $password = $FORM{'password'};
> 
> if ($username ne "$un" or $password ne "$pw"){
> print <<NoPass; (block of html for invalid username/passwordscreen)
> NoPass
> }
> else {
> print <<YesPass; (block of html for Account manager screen)
> YesPass
> }         
> 
> So what do I need to fix to be able to match any username and password and not just 
>the last one created? and by the way all the data is being written to the files and 
>each entry is a new line.
> If anyone is interested in hearing more about my game concept and helping out with 
>any more problems I run into (there will be many) then let me know.
> Thanks
> 
> 
> 
> -------------------------------------------------------------
> Sign up for ICQmail at http://www.icq.com/icqmail/signup.html
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to