Waiting until a variables value isset to display it php : <p>I have a variable $infoCollectedAndSold that is being set inside a form (its values are whatever is being checked in the checkbox).
I want to display this variable, once its values are set. Currently the echo is displaying nothing until i submit the form and then the values are displayed from the variable. Is it possible to display the information inside the variable without submitting the form?</p>

<pre><code>//Set variable to the form inputs
$infoCollectedAndSold = "";
if (!empty($_POST['infoCollectedAndSold'])) {
    foreach ($_POST['infoCollectedAndSold'] as $value) {
        $infoCollectedAndSold .= $value . ', ';
    }
}

//Display variable content (Does not display until form is submitted)
&lt;?php
if(isset($infoCollectedAndSold)){
   echo '&lt;h3&gt;'.$infoCollectedAndSold.'&lt;/h3&gt;';
}
?&gt;
</code></pre>
