How do I save to file using FormMail?

This article details how to save form submission data to a file in FormMail.

This example demonstrates using FormMail to save form submission data to a file. Try a demo.

Form

<html>
<head><title>Just testing</title></head>
<body>
<form method="post" action="http://tigger.uic.edu/htbin/cgiwrap/bin/formmail/FormMail/depts/accc/forms/formmail/example-9.txt">
<h1>Example of FormMail 3.0</h1>
This example shows how to write to a file.
But the write is set to NOFILE, so this demo is not live.
<hr>
<p>
My email address is: 
<input type="text" name="email" >
<p>
FormMail 2.0 is such an improvement over 1.0 that:<br>
<input type=radio name="radbut" value="socks">
My socks were knocked off!<br>
<input type=radio name="radbut" value="chair">
I fell of my chair.<br>
<input type=radio name="radbut" value="big deal">
What's the big deal? Just use postcards. <br>
Free-form comments, if you like;
<textarea name=comments rows=5 cols=60>
</textarea>
<hr>
<input type="submit" value="Submit your comments">
</form>
</body>
</html>

Configuration file

<!DOCTYPE form SYSTEM 'FormMail-3.0.dtd'>
<form debug name="example9" contact="bobg@uic.edu">

<!-- Here I put a mail section with NOMAIL, so that
   nothing will be sent. -->

<mail NOMAIL name="mail1" >
</mail>

<!-- Here is the file section.  In production, I'd have to
  remove the NOFILE option.  Note that by using the <filename>
  tag, I'll append info to an existing file. -->

<file NOFILE name="filesection">
<filename>/path/to/some/file</filename>
<body>
$fm_referer;$radbut;$comments
</body>
</file>



Keywords:mail, data, code, script, form   Doc ID:91749
Owner:Radhika R.Group:University of Illinois at Chicago ACCC
Created:2019-05-15 08:00 CSTUpdated:2019-06-11 12:28 CST
Sites:University of Illinois at Chicago ACCC
Feedback:  0   0