http://www.perlmonks.org?node_id=206542


in reply to Re: saving data problem
in thread saving data problem

Looking at the code again, I noticed you had (comments removed):

my $q = new CGI; my $action = $q->param('action'); my $month = param('month'); my $date = param('date'); my $year = param('year'); my $title = param('title'); my $message = param('message'); my $placement = param('placement');

I believe the issue is that you're retrieving them as my $variable = param('key'); when you should have it (I believe) as my $variable = $q->param('key'); for those lines. Try that, and see if it might take care of the issue for you. Just a thought.

Update (19 Oct 2002): In attempting to run the script from the command-line to figure out what else might be wrong, I received an error message about $placement not being defined, using the code you posted above. Did you leave out the code that set the value for that? Testing from the command line (-debug option required for this in the use statement for some versions of CGI.pm), when action was passed as 'add_event', what was written to the file was what I handed it for all of the other values. Are you seeing any error messages in your logs?

Update (19 Oct 2002): Something else I'm goig to ask just to ask, but I didn't see the elements you were passing in the form in the posting. Did you remove the <input> tags from the sample form? Those tags would have to appear between the <form></form> elements... Just thought I would ask...