Note, I've tried this with and without the delete function that here preceeds the update. Also, I am not certain that the character appended is always %09, but I know with the comment field it is definitely %09.
dbmopen(%synusers,"synusers",0666) || die "Can't open synusers DBM fil
+e\n";
#search database entries
while (($key, $value) = each(%synusers)){
if (index($key,$fields{'updalumname'})!=-1){
($alumemail, $emailpub, $alumsnail1, $snail1pub, $alumsna
+il2, $snail2pub, $alumsnail3, $snail3pub,
$phone, $phonepub, $alumyears, $yearspub, $comment, $comme
+ntpub, $synpass, $synpass2)=split(/::/,$value);
if ($fields{'synpassold'} ne $synpass2){
print "Content-type: text/html", "\n\n";
print "Incorrect password. If you cannot remember you
+r old password, email the webmaster.";
die;
}
if ($fields{'updsynpass'}==""){
$fields{'updsynpass'}=$synpass2;
$fields{'updsynpass2'}=$synpass2;
}
delete $synusers{$fields{'updalumname'}};
$synusers{$fields{'updalumname'}}="
$fields{'updalumemail'}::$fields{'updemailpub'}::
$fields{'updalumsnail1'}::$fields{'updsnail1pub'}::$fields
+{'updalumsnail2'}::$fields{'updsnail2pub'}::
$fields{'updalumsnail3'}::$fields{'updsnail3pub'}::$fields
+{'updphone'}::$fields{'updphonepub'}::$fields{'updalumyears'}::$field
+s{'updyearspub'}::
$fields{'updcomment'}::$fields{'updcommentpub'}::$fields{'
+updsynpass'}::$fields{'updsynpass2'}";
print "Content-type: text/html", "\n\n";
print "Thank you for updating your information.";
die;
}
}
Edit by dws to add <code> tag
|