I am wanting my perl script to save the results of a form to another directory (not located in the cgi-bin folder. I'd like to save the results as a .txt file or .html but anytime I try to have the script save the results in another folder it stops working. It seems like such an easy task I just can't get it to work so thought I should ask. I am wanting the results to be viewable from a web browser, nothing to fancy.
This Works (saves results to the cgi-bin folder)
#save form data to a file
open(OUTFILE, ">>", "survey.txt")
or die "Error opening survey.txt. $!, stopped";
print OUTFILE "$game, $commercial\n";
close(OUTFILE);
This does not
#save form data to a file
open(OUTFILE, ">>", "/public_html/survey.txt")
or die "Error opening survey.txt. $!, stopped";
print OUTFILE "$game, $commercial\n";
close(OUTFILE);
This Works (saves results to the cgi-bin folder)
#save form data to a file
open(OUTFILE, ">>", "survey.txt")
or die "Error opening survey.txt. $!, stopped";
print OUTFILE "$game, $commercial\n";
close(OUTFILE);
This does not
#save form data to a file
open(OUTFILE, ">>", "/public_html/survey.txt")
or die "Error opening survey.txt. $!, stopped";
print OUTFILE "$game, $commercial\n";
close(OUTFILE);