Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [megaline] change the data of registration

Quote Reply
Re: [megaline] change the data of registration In reply to
Hi,
I use the following code in my Home.pm, I used "profile_form.html" posted by STONE and I just added a submit button to the form. Now When I do "do=profile_form" I get my page an error message: Unknow tag Username....
Then I push the submit button after completing the form and I get: "Invalid Action" message.
Anyone could help to set this script to work correctly?

$COMPILE{profile_form} = <<'END_OF_SUB';
sub profile_form {
#------------------------------------------------------------------------
# Profile form
#
my($self,$msg) = @_;
return ('profile_form.html', {
msg => $self->_language('MSG_PROFILE'),
header => $self->_language('HEA_PROFILE')
});
}
END_OF_SUB

$COMPILE{profile} = <<'END_OF_SUB';
sub profile {
#------------------------------------------------------------------------
# Modify profile (custom)
#
my $self = shift;
my $user_tab = $self->{cfg}->{'user_table_use'};
my $db = $self->{sql}->table($user_tab);
my $cols = $db->cols;
my $req = {};
my $opt = {};

foreach my $c ( keys %$cols ) {
next if ( ! $self->{cgi}->{'req_'.$c} );
next if ( $c =~ /^(Username|Status|ReceiveMail|Newsletter|view_p|add_p|delete_p|modify_p|admin_p)/ );
$req->{$c} = $self->{cgi}->{"req_$c"};
}
$db->update($req, { 'Username' => $self->{user}->{Username} }) if ( $req );

foreach my $d ( keys %$cols ) {
next if ( $d =~ /^(Username|Status|ReceiveMail|Newsletter|view_p|add_p|delete_p|modify_p|admin_p)/ );
$opt->{$d} = $self->{cgi}->{"opt_$d"} if (defined $self->{cgi}->{"opt_$d"});
}
$db->update($opt, { 'Username' => $self->{user}->{Username} }) if ( $opt );

$self->auth_logging('profile change ') if ( $self->{cfg}->{log_file} );
return ('profile_form.html', {
msg => $self->_language('MSG_PROFILE_OK'),
header => $self->_language('HEA_HOME')
});
}
END_OF_SUB

Thank you
Ali
Ali
Subject Author Views Date
Thread change the data of registration hoefti 10962 Aug 1, 2002, 9:01 AM
Thread Re: [hoefti] change the data of registration
604 10785 Aug 13, 2002, 4:36 PM
Thread Re: [TheStone] change the data of registration
olivers 10526 Feb 29, 2004, 9:44 AM
Thread Re: [olivers] change the data of registration
604 10456 Mar 1, 2004, 5:05 PM
Thread Re: [TheStone] change the data of registration
olivers 10428 Mar 3, 2004, 6:39 AM
Thread Re: [olivers] change the data of registration
604 10454 Mar 3, 2004, 9:55 AM
Post Re: [TheStone] change the data of registration
olivers 10403 Mar 4, 2004, 3:17 AM
Post Re: [TheStone] change the data of registration
olivers 10387 Mar 6, 2004, 10:01 AM
Thread Re: [TheStone] change the data of registration
olivers 10326 Mar 20, 2004, 12:52 PM
Thread Re: [olivers] change the data of registration
604 10368 Mar 22, 2004, 10:38 AM
Thread Re: [TheStone] change the data of registration
olivers 10326 Mar 29, 2004, 9:35 AM
Thread Re: [olivers] change the data of registration
olivers 10196 Apr 5, 2004, 7:37 AM
Thread Re: [olivers] change the data of registration
604 10186 Apr 5, 2004, 10:16 AM
Thread Re: [TheStone] change the data of registration
olivers 10190 Apr 5, 2004, 11:08 AM
Thread Re: [olivers] change the data of registration
olivers 10174 Apr 12, 2004, 10:03 AM
Thread Re: [olivers] change the data of registration
olivers 10154 Apr 13, 2004, 1:23 PM
Thread Re: [olivers] change the data of registration
megaline 9909 Jul 7, 2004, 4:00 PM
Thread Re: [megaline] change the data of registration
megaline 9889 Jul 8, 2004, 7:04 AM
Post Re: [megaline] change the data of registration
olivers 9869 Jul 8, 2004, 3:48 PM