Help with a Profile Managment System

Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2008
Posts: 128
Reputation: kenji is an unknown quantity at this point 
Solved Threads: 10
kenji's Avatar
kenji kenji is offline Offline
Junior Poster

Help with a Profile Managment System

 
0
  #1
Aug 11th, 2008
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]
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 46
Reputation: Major Major is an unknown quantity at this point 
Solved Threads: 2
Major Major Major Major is offline Offline
Light Poster

Re: Help with a Profile Managment System

 
0
  #2
Aug 15th, 2008
you've got your causality reversed in the first if statement.

  1. if ($env eq "GET")
  2. {
  3. validate();
  4. }
  5. else
  6. {
  7. displayform();
  8. }
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Perl
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC