Kbase P22739: How to save HTML form information to a txt file.(On the serv
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/25/2003 |
|
Status: Unverified
GOAL:
How to save HTML form information to a txt file.(On the server)
FIX:
Save the code below as Example_capture.html into your wrk dir and compile. It does not require DB access.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<META NAME="AUTHOR" CONTENT="Alex Pearlstein">
<TITLE>How to capture content to a file</TITLE>
<SCRIPT LANGUAGE="SpeedScript">
/* Create an unnamed pool to store all the widgets created by this procedure.
This is a good default which assures that this procedure's triggers and
internal procedures will execute in this procedure's storage, and that
proper cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.
Def var custid as CHARACTER.
Def var fileid as CHARACTER.
PROCEDURE output-header:
Assign custid = "11"
fileid = "c:\temp\" + String(custid) + ".txt".
IF get-value("action") = "write" THEN do:
output to value(fileid).
Put Unformatted url-field-list("tcustNum,tstate,taddress,tname,tcity", ",").
output close.
END.
END Procedure.
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="SpeedScript">
</SCRIPT>
<Form method="POST" Name="logon" action="Example_capture.html">
<table>
<TR><TD>number</TD><TD><input type="text" size="20" name="tcustNum" value=""></TD></TR>
<TR><TD>country</TD><TD><input type="text" size="20" name="tstate" value=""></TD></TR>
<TR><TD>name</TD><TD> <input type="text" size="20" name="tName" value=""></TD></TR>
<TR><TD>address</TD><TD> <input type="text" size="20" name="taddress" value=""></TD></TR>
<TR><TD>city</TD><TD> <input type="text" size="20" name="tcity" value=""></TD></TR>
</table>
<input type="submit" name="action" value="Write">
<BR>
<BR>
` `
</BODY>
</HTML>