Sending $_POST without submitting a form?
<p>I'm working on a script for forms that submits the data to itself to check for errors, if there are no errors it uses header() to send them to the next page. Is there a way I can send the $_POST data to the next page as well without the form being re-submitted?</p>

<pre><code>    &lt;?php

if (isset($_POST['submit'])) {
    $errors = array();
    $moo = array();

    if (empty($_POST['a'])) {
        $errors[] = 'You forgot to answer Question 1!&lt;br/&gt;';
    } else {
        $moo = $_POST['a'];
    }

    if (empty($_POST['b'])) {
        $errors[] = 'You forgot to answer Question 2!&lt;br/&gt;';
    }

    if (empty($_POST['c'])) {
        $errors[] = 'You forgot to answer Question 3!&lt;br/&gt;';
    }

    if (empty($errors)) {

        $_POST['aids'] = "RAWR";
        $url = "http://localhost/test/test.php?page=2";
        header("Location: $url");
        exit();
    } else {
        foreach ($errors as $error) {
            echo $error;
        }
    }
}

echo "
    &lt;form action=\"test.php?page=1\" method=\"post\"&gt;
        &lt;input type=\"text\" name=\"a\" value=\"" . $_POST['a'] . "\"&gt;
        &lt;input type=\"text\" name=\"b\" value=\"" . $_POST['b'] . "\"&gt;
        &lt;input type=\"text\" name=\"c\" value=\"" . $_POST['c'] . "\"&gt;
        &lt;input type=\"submit\" name=\"submit\"&gt;
    &lt;/form&gt;
";

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