Thank you for the answer Joseph. Sorry, I was not trying to shout with the caps, merely attempting to set those comments apart from the other comments in the code.
I had sent out another email to the list stating that I found the problem and that it existed in the "SaveChanges" function. I was printing a debug string before printing the HTML page header. It was very difficult to track down as I had placed the line to print the page header in places I thought were key in an attempt to trap the error. But, of course, the error was not where I thought it should be. =) As with the other email I'd sent to the list, I apologize for making the inquiry before I had thoroughly checked my own code. Ron Goral -----Original Message----- From: R. Joseph Newton [mailto:[EMAIL PROTECTED] Sent: Sunday, September 14, 2003 12:17 AM To: Ron Goral Cc: Charles K. Clarkson; 'Perl Beginners' Subject: Re: Browser wants to do a file download on a CGI script Ron Goral wrote: > > > sub main > { > # > Debugging ----------------------------------------------------------------# > print $h_self{page_header} if $h_self{debug}; > > #--------------------------------------------------------------------------- > # > > # Create objects > CreateObjects(); # THIS EXECUTES > > # Create the database connection. Will exit if there is an error. > CreateDatabaseConnection(); # THIS EXECUTES > > # Get configuration data. > GetConfigData('dg_sc_config'); # THIS EXECUTES > > # Get the form data > GetFormVars(); # THIS EXECUTES > > # Branch based on cmd > # THIS BLOCK EXECUTES > if ($FORM{cmd} eq 'login') > { > if (ValidateForm()) > { > if (DoLogin()) > { > SetLoginCookie(); > $FORM{cmd} = 'config_manager'; > } > else{$FORM{cmd} = '';} > } > else{$FORM{cmd} = '';} > } > > # THIS BLOCK EXECUTES > if (!$LOGIN{auth_level}){GetLoginCookie();} > > # Check for authorization level and branch based on command > # THIS BLOCK EXECUTES > if ($LOGIN{auth_level}) > { > my $auth = $LOGIN{auth_level}; > # Administrators > if ($auth >= 10) > { > if ($FORM{cmd} eq 'config_manager'){;} > # Save changes to configuration settings > elsif ($FORM{cmd} eq 'save_changes' && $FORM{form_name} =~ > m/config/) > {if (SaveChanges()){$FORM{cmd} = 'confirm_config_changes';}} > } > else {$LOGIN{auth_level} = 0;} > } > else {$LOGIN{auth_level} = 0;} > > PrintAdminPage(); > } #end main > > # Various methods defined here.... Except the one we need to see. Where is GetConfirmConfigScreen() defined? > > > #WHEN THE CONFIGURATION CHANGES ARE SAVED, THE DATA IS SAVED TO THE > DATABASE. This comment is outside of any execution block. Does the problem occur in all. On the assumption that you mean this occurs only in the confirmation branch, I would recommend that you look at the GetConfirmConfigScreen() function. > > #HOWEVER, THIS "HERE DOCUMENT" DOES NOT PRINT TO SCREEN. INSTEAD, THE USER Please! You can have our attention without shouting. > > #IS PROMPTED TO EITHER SAVE OR OPEN A FILE DOWNLOAD OF THE .CGI SCRIPT. IF > #THE FILE IS SAVED, IT DOES CREATE THE HTML, BUT IT IS IN A FILE NAMED > #dgCartAdmin.cgi. THE STRANGE THING IS THAT IF ONE OF THE OTHER COMMANDS > ARE > #SENT IN THE SCRIPT, THIS "HERE DOCUMENT" PRINTS EXACTLY AS IT SHOULD. > print<<HTML; > <html> > <head> > <title>$title$heading</title> > <meta http-equiv="content-Type" content="text/html; charset=iso-8859-1"> > <meta http-equiv="content-language" content="en-US"> > The vast vajoprity of the content of the page itself is not relevant to the question. All code in the chain of execution is. Please try to trace the chain of execution where the problem occurs, and send the definitions of all subroutines called. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]