ACJavascript
11-23-2002, 09:07 PM
Hello All :D,
Heres my problem.
I have a script that creates members with there own usernames.
Now there usernames are written to a .db file.
What i am trying to do but seem to be failing at is to pull the .db file and check it for a username.
Essentialy I want to see if a username some types in has already been taken.
Heres the part of my script that does this.
What ap i doing wrong:(
The below script does an if else structure,, If a username is used it writes to the window saying you have to choose another one.. Else it writes the username to the database.
------------------------------------------
open(Log,"$directoryM/MembersLog.db") || print "Error: Cant open Member database to (read)";
@names = <Log>;
close(Log);
foreach $UName(@names){
($UNames) = split(/\|/,$Uname);
}
if($FORM{'username'} eq "$UNames"){
print "Content-type:text/html\n\n";
print <<UsedName;
<html><head><title>V.R.S.G.C [ USSED USERNAME ] </title></head><body bgColor="black" text="white">
<center><BR>
<font face="verdana,arial" color="red" size=4><b>Error:</b> The Username: $FORM{'username'}. Has already been chosen.<BR>
Please hit back and try again.</font>
If you have any more difficulties please contact support at: <a href="mailto:support@bandit.addr.com">support@bandit.addr.com</a>
<hr width=30>
<sup>Maintained by V.R.S.G.C Member Funtions ver 1.1</sup>
UsedName
exit;
}else{
$username=$FORM{'username'};
open(WriteLog,">>$directoryM/MembersLog.db") || print "Error: Can't open Member database to (write)";
print WriteLog "$username|\n";
close(WriteLog);
&WriteDataAndEmail;
}
___________________
Please help
Thanks in advance!!
Heres my problem.
I have a script that creates members with there own usernames.
Now there usernames are written to a .db file.
What i am trying to do but seem to be failing at is to pull the .db file and check it for a username.
Essentialy I want to see if a username some types in has already been taken.
Heres the part of my script that does this.
What ap i doing wrong:(
The below script does an if else structure,, If a username is used it writes to the window saying you have to choose another one.. Else it writes the username to the database.
------------------------------------------
open(Log,"$directoryM/MembersLog.db") || print "Error: Cant open Member database to (read)";
@names = <Log>;
close(Log);
foreach $UName(@names){
($UNames) = split(/\|/,$Uname);
}
if($FORM{'username'} eq "$UNames"){
print "Content-type:text/html\n\n";
print <<UsedName;
<html><head><title>V.R.S.G.C [ USSED USERNAME ] </title></head><body bgColor="black" text="white">
<center><BR>
<font face="verdana,arial" color="red" size=4><b>Error:</b> The Username: $FORM{'username'}. Has already been chosen.<BR>
Please hit back and try again.</font>
If you have any more difficulties please contact support at: <a href="mailto:support@bandit.addr.com">support@bandit.addr.com</a>
<hr width=30>
<sup>Maintained by V.R.S.G.C Member Funtions ver 1.1</sup>
UsedName
exit;
}else{
$username=$FORM{'username'};
open(WriteLog,">>$directoryM/MembersLog.db") || print "Error: Can't open Member database to (write)";
print WriteLog "$username|\n";
close(WriteLog);
&WriteDataAndEmail;
}
___________________
Please help
Thanks in advance!!