Hello,
I have a form and when the user submit the form, I need to make sure that email/username is not taken. All my user's directory is like this:
| | |
ROOT USERS USER-EMAILS
Each User-Emails contains the following files.
user.txt - inludes username
pass.txt - includes password
gender.txt - includes gender.
I need to make sure when the user submit the form, that the email/username is not taken. For the email part, i did the following:
if (-e "$basedir/users/$FORM{'email'}"
{
print "That email is already taken!";
exit;
}else{
&name_check;
}
And for the username check, i need to open all the directories in the $root/cgi-bin/users and open all the files called user.txt and to make sure if it's taken or not. Now it seems a little silly to do all these stuff just to make sure that the username is taken or not, but I don't know any other way to do it. Any clue? No?
I have a form and when the user submit the form, I need to make sure that email/username is not taken. All my user's directory is like this:
| | |
ROOT USERS USER-EMAILS
Each User-Emails contains the following files.
user.txt - inludes username
pass.txt - includes password
gender.txt - includes gender.
I need to make sure when the user submit the form, that the email/username is not taken. For the email part, i did the following:
if (-e "$basedir/users/$FORM{'email'}"

print "That email is already taken!";
exit;
}else{
&name_check;
}
And for the username check, i need to open all the directories in the $root/cgi-bin/users and open all the files called user.txt and to make sure if it's taken or not. Now it seems a little silly to do all these stuff just to make sure that the username is taken or not, but I don't know any other way to do it. Any clue? No?