Lesson 09: Writing to Data Files

This example uses the [[APPEND_FILE]] shortcode to store the form response in a data file called comments.txt located in the node’s root folder. Note that the \t creates a tab delimiter and the \n creates a new line in output string to be stored. To overwrite previous content use [[WRITE_FILE]] instead.

Create a node and paste this following code into it’s landing page editor.  Goto the node’s address and test with browser.

 Thank you [[PRINT:Name]] , your comment has been added to the file.[[cr]]
Here is the comment form.[[cr]][[hr]]
 [[INPUT:Name|Enter Your Name]]
 [[INPUT:Message|Enter Your Comment]]

Leave a Reply