in reply to cgi won't write to file thru browser

So, what is the output of the program when run through the browser?

Also, what is the output in the web server error log? You print to it in the case of an error, but maybe you want to also signal this condition to the browser, even if only for debugging?

open (FILE, ">>$db") or print STDERR "[$0] Could not open file! $!";

... should either be

open (FILE, ">>$db") or die "[$0] Could not open file! $!";

or should be something like:

if( open (FILE, ">>$db")) { print (FILE "Name:$name,Surname:$sname\n"); close (FILE); } else { print STDERR "[$0] Could not open file '$db': $!"; print "<b>Sorry, an error happened: $!"; };

Replies are listed 'Best First'.
Re^2: cgi won't write to file thru browser
by MainCoon (Novice) on Sep 27, 2015 at 12:02 UTC

    Parameters name=Simon.. surname=>br>

      SORTEd IT!!!!

      I checked back at the error.log for apache2 and quickly realised my Issue. :)

      THANKS Perl Monks, Monastery rocks!

        Corion led you to finding out the problem, now it's customary to either reply back to your question with a response of what you found and what solved the issue, or update your question with an Update: section that includes this information for the benefit of future readers.