Submitting form results that there is no error to another page
<p>i want to know how to send value form my_name in index.php below to result.php.</p>

<p>below is the php code to check for errors after the input form.
and how to send form results that there is no error to result.php</p>

<p>here is index.php</p>

<pre><code>&lt;?php 
if ($_POST["_submit_check"]) {
    if ($form_errors = validate_form()) {
    show_form($form_errors);
    } else {
process_form();
}
} else {
show_form();
}

function process_form() {
//if doesnt makes error
//i want to send result "my_name" to result.php
header('Location: result.php');
}

function show_form($errors = '') {
    if ($errors) {
    print implode('&lt;/li&gt;&lt;li&gt;&lt;br&gt;', $errors);
    print '&lt;/li&gt;&lt;/ul&gt;';
}
print&lt;&lt;&lt;_HTML_
&lt;form method="POST" action="$_SERVER[PHP_SELF]"&gt;
Your name: &lt;input type="text" name="my_name"&gt;$errors[0];
&lt;br/&gt;
&lt;input type="submit" value="Submit"&gt;
&lt;input type="hidden" name="_submit_check" value="1"&gt;
&lt;/form&gt;
_HTML_;
}

function validate_form() {
    $errors = array();
    if (strlen($_POST['my_name']) &lt; 3) {
    $errors[] = "Your name must be at least 3 letters long.";
    }
    return $errors;
}

?&gt;
</code></pre>

<p>here is result.php</p>

<pre><code>&lt;?php
//prints result form from index.php
?&gt;
</code></pre>
