| | |
Help with a Profile Managment System
Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Hey everyone, I have a question about Perl CGI. I am creating a profile management system using Perl CGI for an assignment and am having a little trouble understanding to go about it. My code is written using subroutines and it interfaces with one another by calling a subroutine.
A Main loads and allows you to login after logging in you have to options update profile or delete. My problem is that every time I try to process the update forms it takes me back to the login page instead of updating the profile and displaying results.
Any advise on what I am doing wrong. I would enter my code but since its for a school project I am not sure its wise. But basically it goes like this. &login calls a account management page which allow you to update the data but I keep coming back to my main login everytime I click submit.
[code = perl]if ($ENV{REQUEST_METHOD} eq "GET")
{
&print_form;
}
else
{
# Validate form input
my %errors = %{$cgi->errors()};
# In case of errors, whow the form again with warnings
# Otherwise complete registration
if (%errors)
{
&print_form(\%errors);
}
else
{
&login();
}
}[\code]
A Main loads and allows you to login after logging in you have to options update profile or delete. My problem is that every time I try to process the update forms it takes me back to the login page instead of updating the profile and displaying results.
Any advise on what I am doing wrong. I would enter my code but since its for a school project I am not sure its wise. But basically it goes like this. &login calls a account management page which allow you to update the data but I keep coming back to my main login everytime I click submit.
[code = perl]if ($ENV{REQUEST_METHOD} eq "GET")
{
&print_form;
}
else
{
# Validate form input
my %errors = %{$cgi->errors()};
# In case of errors, whow the form again with warnings
# Otherwise complete registration
if (%errors)
{
&print_form(\%errors);
}
else
{
&login();
}
}[\code]
•
•
Join Date: May 2008
Posts: 46
Reputation:
Solved Threads: 2
you've got your causality reversed in the first if statement.
Perl Syntax (Toggle Plain Text)
if ($env eq "GET") { validate(); } else { displayform(); }
![]() |
Other Threads in the Perl Forum
- Previous Thread: Regex matches all but specific word?
- Next Thread: What regular expression should be written?
| Thread Tools | Search this Thread |
Tag cloud for Perl





