
parham_m_s
journeyman
Jan 7, 2001, 4:17 PM
Post #5 of 5
(317 views)
|
Siranvil, in your case, i wouldn't at all recommend that two people have the same username and different passwords. If one person, in the future decides to change their password, and picks the same password as another person with the same username, your database will end up messing up. What you could do is this (just a change to the above code):
open(FILE, "$memberlistfile") or (FILE ERROR) flock (FILE, 2); @memberlist = <FILE>; flock (FILE, 8); close(FILE); foreach $memberlist (@memberlist) { if ($memberlist =~ /\n$/) { chop $memberlist; } ($data_username, $data_password) = split(/\|/, $memberlist); if ($form_username =~ /^$data_username$/i) { print "Username already taken please do the sign-up process again with a different username"; } } i wrote this in mind that your username and password databases are separated using pipes (username|password).
(This post was edited by parham_m_s on Jan 7, 2001, 3:19 PM)
|