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 | |
by MainCoon (Novice) on Sep 27, 2015 at 12:09 UTC | |
by stevieb (Canon) on Sep 27, 2015 at 13:11 UTC |