954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help with a Profile Managment System

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]

kenji
Junior Poster
145 posts since May 2008
Reputation Points: 11
Solved Threads: 11
 

you've got your causality reversed in the first if statement.

if ($env eq "GET")
{
  validate();
}
else
{
  displayform();
}
Major Major
Light Poster
46 posts since May 2008
Reputation Points: 16
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You