The basic gist of this is USER comes to site, fills out form, clicks Submit button, and then gets a Thankyou page. (I've got all that done, for the most part.) The part I need help with is this -- ADMIN goes to (dfferent) page and views all submissions (sort of like online applications) in pretty HTML layout. This make sense?
My current script for writing to the .txt datafile is as follows:
sub write_form_info{
open (FORM, ">>$form_info_path") ¦¦ die ("I am sorry, but I was unable to open the file $form_info_path");
foreach $sortedkeys (@sortedkeys){
$sortedkeys =~ s/^\d*\)\s*//;
$sortedkeys =~ s/required-//;
($name, $answer) = split (/\¦/, $sortedkeys);
print FORM "$answer¦\n";
}
print FORM "\n";
close (FORM);
}
And the way the datafile is displayed is like this:
name¦
fieldone¦
email@addy.com¦
fieldtwohuge¦
etc.
What do I need to do to get it to display as:
name¦fieldone¦email@addy.com¦fieldtwohuge
And once I get to that stage, what sort of file would pull these fields into an HTML page? Thanks for the help!
Thanks so much!
print FORM "$answer¦\n";
read from file:
print "<html><head><title></title></head><body>\n";
open(FILE, "< filename.txt") or die "cannot open filename.txt";
while (<FILE>) {
my ($name, $fieldone, $email, fieldtwo) = split(/\¦/);
print "$name, $fieldone, $email, fieldtwo<br>\n";
}
close(FILE) or die "cannot open filename.txt";
print "</body></html>";