Creating html file with comments submitted by user through a form

I would like to write a perl script (don't know if possible) that will take the information from a form (submitted by the user on the web-site) and create an html file. Each time a user submits the form, the information is appended to the html page that has been created. Therefore, the users can interactively communicate with each other ..so to speak! I am able to write a perl script that sends me an email with the information in the form but I don't know how to append to an html file that I have already created. Any information/references or example code will be much appreciated!
kandrouAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

binkzzCommented:
Say your original file was called:

index.html

And the perl script need to append to that like this:

#

open outfile, ">>index.html";
  print outfile "Newentry <br>\n";
close outfile;

#

That should append to the current html file and html code you'd give to it.

I think that's what you want.. ?
0
kandrouAuthor Commented:
Does it append the information from the form to the end or middle of the html file? I ask this because if I have an HTML template and each time the form is submitted it adds the text to the end, what happens to the ending tags in the html file ie. </body></head>
0
binkzzCommented:
The way I do it it will add to the end of the file. Alternatively, you can do this:

You have these files:

header.html
inbetween.html
footer.html

And do this with it:

open outfile, ">index.html";

  open infile, "<header.html";
    print outfile <infile>;
  close infile;

  open infile, "<inbetween.html";
    print outfile <infile>;
  close infile;

  print outfile, "Data you want to add";

  open infile, "footer.html";
    print outfile <infile>;
  close infile;

close outfile;



This would accomplish what I think you want
0
binkzzCommented:
Make that last

open infile, "footer.html";
  print outfile <infile>;
close infile;

to:

open infile, "<footer.html";
  print outfile <infile>";
close infile;

Thank you :)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kandrouAuthor Commented:
Thanks!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.