If a script being executed has form data posted in it’s request headers, this data may be automatically assigned to variables using the [[POST]] shortcode.
[[POST:First_Name]] [[POST:Last_Name]] Hello [[PRINT:First_Name]], [[PRINT:Last_Name]]
To combine the form and the handler into the same script we may use the [[IF_SUBMITTED]] with the [[ELSE]] and [[END_IF]] shortcodes to add flow control for the conditionally executed code.
Create a node and paste this following code into it’s landing page editor. Goto the node’s address and test with browser. Note that the first input value is preloaded or prepopulated with the value of the query string variable anything.
When testing this script add /?anything=testing123 to the URL. You should then see testing123 already written (prepopulated) into the First_Name form input field.
[[IF_SUBMITTED]] Form Submitted[[cr]] [[POST:First_Name]] [[POST:Last_Name]] Hello [[PRINT:First_Name]], [[PRINT:Last_Name]][[cr]] [[ELSE]] Here is the form.[[cr]][[hr]] [[QUERY_STRING:anything]] [[PRINT:anything]] [[FORM:#this]] [[INPUT:First_Name|[[=anything]]]] [[INPUT:Last_Name|Enter Your Last Name]] [[SUBMIT:Save]] [[END_OF_FORM]] [[END_IF]]