asukla wrote:When the Forms load it automatically called datafile(). So datafl gets value at once. What's the problem?
Only when the form is loaded. And it only does that if $POST['Submit'] does not equal 'Submit'. reg() is called only when $POST['Submit'] does equal 'Submit'.
<?php
if ($_POST['Submit'] == 'Submit')
{
$fb =reg();
echo $fb;
exit();
}else {
$fl= datafile();
?>
I think what you're thinking here is that values assigned to a variable in one request will still be there in the next request, right?