No alternative, it's just a logo.
Self-hosted PHP form processor

Pre-populate form

Applies to the pro version

In some cases a web browser will clear values entered on a form when a user returns to it, such as a user might do in the case of an error, which means the user gets presented with a blank form and has to re-enter the information they had previously entered. You can prevent this by pre-populating the form with the values the user submitted.

To pre-populate the form, your form page needs to be a PHP page, with a .php extension, like contact.php for example. If it's an HTML page, just save it with a .php extension.

Get form values from session

Put this at the top of your form page:

<?php

session_start();

if(isset($_SESSION['submitted_form_values']))
{

extract($_SESSION['submitted_form_values']);
unset($_SESSION['submitted_form_values']);

}

?>

For each input on your form that a visitor interacts with (text, radio button, checkbox etc) you need to have a line of code like this:

<?php if(isset($form_field_name)){print htmlspecialchars($form_field_name);} ?>

It is used to print a value in the form field. $form_field_name is replaced with a variable that is EXACTLY the same name as the form field ($form_field_name is just a generic example of a variable, you don't actually use it in your code).

Text inputs

Suppose you have a text input on your form, like this:

<input type="text" name="First_Name">

To show the value the visitor entered, put the above PHP code into a value for the field, like so:

<input type="text" name="First_Name" value="<?php if(isset($First_Name)){print htmlspecialchars($First_Name);} ?>">

Note that "$First_Name" is used (two instances) in place of the generic "$form_field_name". Do the same for all text inputs, replacing $form_field_name with the exact (case sensitive) variable name of the form field (the preceding dollar sign makes it a variable).

You can show a default value for a text input, like so:

<input type="text" name="First_Name" value="<?php if(isset($First_Name)){print htmlspecialchars($First_Name);}else{print "some default value";} ?>">

Select inputs (drop-down options)

Change this:

<select name="fruit">
<option>Pear</option>
<option>Apple</option>
<option>Orange</option>
</select>

...to this:

<select name="fruit">
<option<?php if(isset($fruit) && $fruit == "Pear"){print " selected=\"selected\"";} ?>>Pear</option>
<option<?php if(isset($fruit) && $fruit == "Apple"){print " selected=\"selected\"";} ?>>Apple</option>
<option<?php if(isset($fruit) && $fruit == "Orange"){print " selected=\"selected\"";} ?>>Orange</option>
</select>

If you have a very long list of options and you don't want to code the form to within an inch of its life, you could try this workaround:

<select name="fruit">
<option><?php if(isset($fruit)){print htmlspecialchars($fruit);} ?></option>
<option>Pear</option>
<option>Apple</option>
<option>Orange</option>
</select>

To show a default selected option, use this additional piece of code:

if(!isset($fruit)){print " selected=\"selected\"";}

Using the above code, if you want "Orange" to be the default selected option, use this code:

<select name="fruit">
<option<?php if(isset($fruit) && $fruit == "Pear"){print " selected=\"selected\"";} ?>>Pear</option>
<option<?php if(isset($fruit) && $fruit == "Apple"){print " selected=\"selected\"";} ?>>Apple</option>
<option<?php if(!isset($fruit)){print " selected=\"selected\"";} elseif(isset($fruit) && $fruit == "Orange"){print " selected=\"selected\"";} ?>>Orange</option>
</select>

Textareas

Change this:

<textarea name="message"></textarea>

...to this:

<textarea name="message"><?php if(isset($message)){print htmlspecialchars($message);} ?></textarea>

To show default text in a textarea, use this code:

<textarea name="message"><?php if(isset($message)){print htmlspecialchars($message);}else{print "some default text";} ?></textarea>

Radio buttons

Change this:

<input type="radio" name="vegetable" value="cabbage"> cabbage
<input type="radio" name="vegetable" value="leek"> leek

...to this:

<input type="radio" name="vegetable" value="cabbage" <?php if(isset($vegetable) && $vegetable == "cabbage"){print " checked=\"checked\"";} ?>> cabbage
<input type="radio" name="vegetable" value="leek" <?php if(isset($vegetable) && $vegetable == "leek"){print " checked=\"checked\"";} ?>> leek

To set a default radio button you need to add additional PHP code to that input.

This is the additional piece of code:

if(!isset($vegetable)){print " checked=\"checked\"";}

Using the above code example, if you want the "cabbage" option to be shown checked by default, the code would look like this:

<input type="radio" name="vegetable" value="cabbage"
<?php if(!isset($vegetable)){print " checked=\"checked\"";} elseif(isset($vegetable) && $vegetable == "cabbage"){print " checked=\"checked\"";} ?>> cabbage
<input type="radio" name="vegetable" value="leek" <?php if(isset($vegetable) && $vegetable == "leek"){print " checked=\"checked\"";} ?>> leek

Checkboxes

Change this:

<input type="checkbox" name="fruit[]" value="apple">Apple
<input type="checkbox" name="fruit[]" value="orange">Orange
<input type="checkbox" name="fruit[]" value="pear">Pear

...to this:

<input type="checkbox" name="fruit[]" value="apple" <?php if(isset($fruit) && in_array("apple",$fruit)){print " checked=\"checked\"";} ?>>Apple
<input type="checkbox" name="fruit[]" value="orange" <?php if(isset($fruit) && in_array("orange",$fruit)){print " checked=\"checked\"";} ?>>Orange
<input type="checkbox" name="fruit[]" value="pear" <?php if(isset($fruit) && in_array("pear",$fruit)){print " checked=\"checked\"";} ?>>Pear

To set default checkboxes checked, you need to add additional PHP code to that input.

This is the additional piece of code:

if(!isset($fruit)){print " checked=\"checked\"";}

Using the above code example, if you want the "apple" checkbox to be shown checked by default, the code would look like this:

<input type="checkbox" name="fruit[]" value="apple"
<?php if(!isset($fruit)){print " checked=\"checked\"";} elseif(isset($fruit) && in_array("apple",$fruit)){print " checked=\"checked\"";} ?>>Apple
<input type="checkbox" name="fruit[]" value="orange" <?php if(isset($fruit) && in_array("orange",$fruit)){print " checked=\"checked\"";} ?>>Orange
<input type="checkbox" name="fruit[]" value="pear" <?php if(isset($fruit) && in_array("pear",$fruit)){print " checked=\"checked\"";} ?>>Pear

File inputs

You can't pre-populate a file input. Web browsers don't allow it for security reasons.

extract() function

This line of code (from the code at the top of the page) extracts the submitted form values from the $_SESSION array and puts them into variables. The variable names will be the same as the form field names:

extract($_SESSION['submitted_form_values'])

It will overwrite any variables of the same name that already exist on the page. To avoid this, you should use names for your form fields that you don't use as variable names elsewhere on the page. For more information about the extract() function see this page on the PHP manual

Sample form code

You can get sample code for a basic contact form (name, email, message) that is already coded to show errors on the form page and to pre-populate the form. Get it here