I CRE8

Site Navigation

Retrieve Text Field Value (PHP)

In PHP when you submit a form via the POST method the contents of text fields are stored in the $_POST superglobal array and can be retrieved simply by referencing the field name like so: $_POST['FormTextFieldName'].

So if we have a simple form like this:
<form name="frmTest" action="" method="post">
<p><label for="fname">First Name</label><input name="fname" type="text"></p>
<p><label for="lname">Last Name</label><input name="lname" type="text"></p>
<p><input name="submit" type="submit" value="submit"></p>
</form>

that collects your first name and last name, you would retrieve the contents of the form after submission by calling the form fields like so:

First Name: <?php echo $_POST['fname']; ?>
Last Name: <?php echo $_POST['lname']; ?>

You will find all the form variables available on the page by going to the Bindings Tab of the Application Panel and then you can simply drag and drop them onto the page if you wish.

You can see an example using the above form and download a copy for you to try out yourself.